NUnit.Framework.Assert.AreEqual(int, int)

Here are the examples of the csharp api class NUnit.Framework.Assert.AreEqual(int, int) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

200 Examples 7

51. Example

Project: libpalaso
Source File: BCVRefTests.cs
View license
[Test]
		public void Parse_Intro()
		{
			BCVRef genesisTitleRef = new BCVRef("GEN Intro");
			Assert.AreEqual(1, genesisTitleRef.Book);
			Assert.AreEqual(1, genesisTitleRef.Chapter);
			Assert.AreEqual(0, genesisTitleRef.Verse);
		}

52. Example

Project: libpalaso
Source File: BCVRefTests.cs
View license
[Test]
		public void LastBook_NoDeuterocanon()
		{
			Assert.AreEqual(66, BCVRef.LastBook);
		}

53. Example

Project: libpalaso
Source File: VerseRefTests.cs
View license
[Test]
		public void LastChapter()
		{
			Assert.AreEqual(50, new VerseRef(1, 0, 0, ScrVers.English).LastChapter);
			Assert.AreEqual(40, new VerseRef(2, 0, 0, ScrVers.Vulgate).LastChapter);
			Assert.AreEqual(27, new VerseRef(3, 0, 0, ScrVers.Septuagint).LastChapter);
			Assert.AreEqual(36, new VerseRef(4, 0, 0, ScrVers.RussianProtestant).LastChapter);
		}

54. Example

Project: libpalaso
Source File: CharacterUtilsTests.cs
View license
[Test]
		public void SentenceFinalPunctuation_LocalArrayModified_SentenceFinalPunctuationNotChanged()
		{
			var array = CharacterUtils.SentenceFinalPunctuation;
			var originalFirstElement = array[0];
			array[0] = '$';
			Assert.AreEqual(originalFirstElement, CharacterUtils.SentenceFinalPunctuation[0]);
		}

55. Example

Project: libpalaso
Source File: UsbDeviceInfoTests.cs
View license
[Test]
		[Category("RequiresUSB")]
		[Category("SkipOnTeamCity")]
		[Explicit("Run this test if you have exactly 1 USB drive plugged in")]
		public void GetDrives_1Drive_DrivesAreReturned()
		{
			List<IUsbDriveInfo> usbDrives = UsbDriveInfo.GetDrives();
			Assert.AreEqual(1, usbDrives.Count);
		}

56. Example

View license
[Test]
		public void LatestVersion_IsThree()
		{
			Assert.AreEqual(3, LdmlDataMapper.CurrentLdmlVersion);
		}

57. Example

Project: libpalaso
Source File: UsbDeviceInfoTests.cs
View license
[Test]
		[Category("RequiresUSB")]
		[Category("SkipOnTeamCity")]
		[Explicit("Run this test if you have exactly 2 USB drives plugged in")]
		public void GetDrives_2DrivesArePluggedIn_DrivesAreReturned()
		{
			List<IUsbDriveInfo> usbDrives = UsbDriveInfo.GetDrives();
			Assert.AreEqual(2, usbDrives.Count);
		}

58. Example

Project: TrueCraft
Source File: MathHelperTest.cs
View license
[Test]
        public void TestCreateRotationByte()
        {
            byte a = (byte)MathHelper.CreateRotationByte(0);
            byte b = (byte)MathHelper.CreateRotationByte(180);
            byte c = (byte)MathHelper.CreateRotationByte(359);
            byte d = (byte)MathHelper.CreateRotationByte(360);
            Assert.AreEqual(0, a);
            Assert.AreEqual(128, b);
            Assert.AreEqual(255, c);
            Assert.AreEqual(0, d);
        }

59. Example

View license
[Test]
        public void GetCount()
        {
            // Act
            int count = _customersRepository.Count();

            // Assert
            Assert.AreEqual(2, count);
        }

60. Example

Project: Buildron
Source File: NotificationServiceTest.cs
View license
[Test]
		public void CheckNotifications_Version_NotificationReceivedRaised()
		{
			var notificationReceivedCount = 0;
			m_versionService.Expect (v => v.GetVersion ()).Return (new Version ());
			m_target.NotificationReceived += (sender, e) => notificationReceivedCount++;
			m_target.CheckNotifications (ClientKind.Buildron, SHDeviceFamily.Editor);
			Assert.AreEqual (0, notificationReceivedCount);
			m_notificationClient.Raise (n => n.NotificationReceived += null, null, new NotificationReceivedEventArgs(null));
			Assert.AreEqual (1, notificationReceivedCount);
		}

61. Example

Project: gremit
Source File: HackHelpersTest.cs
View license
[Test]
        public void TestCall()
        {
            CForCallTest.callStatic = 0;
            var c = new CForCallTest();
            HackHelpers.CallMethod(c, test => test.CallInstance(-1), null, new object[] {2});
            Assert.AreEqual(2, c.callInstance);
            Assert.AreEqual(0, CForCallTest.callStatic);
        }

62. Example

View license
[Test]
        public void setPropertyReturnValue()
        {
            MockRepository mocks = new MockRepository();
            IList list = mocks.StrictMock<IList>();
            SetupResult.For(list.Count).Return(42);

            mocks.ReplayAll();

            Assert.AreEqual(42, list.Count);

            mocks.VerifyAll();
        }

63. Example

View license
[Test]
        public void AbuseArrayList_UsingCreateMockGenerics()
        {
            MockRepository mocks = new MockRepository();
            ArrayList list = mocks.StrictMock<ArrayList>();

            // Setup the expectation of a call on the mock
            Expect.Call(list.Capacity).Return(999);
            mocks.ReplayAll();

            // Evaluate the values from the mock
            Assert.AreEqual(999, list.Capacity);
            mocks.VerifyAll(); ;
        }

64. Example

View license
[Test]
        public void MockAGenericInterface()
        {
            MockRepository mocks = new MockRepository();
            IList<int> list = mocks.StrictMock<IList<int>>();

            Expect.Call(list.Count).Return(5);

            mocks.ReplayAll();
            Assert.AreEqual(5, list.Count);
            mocks.VerifyAll();
        }

65. Example

View license
[Test]
        public void UsingPartialMocks_AAA()
        {
            //Arrange
            ProcessorBase proc = MockRepository.GeneratePartialMock<ProcessorBase>();
            proc.Expect(p => p.Add(1)).Return(1);
            proc.Expect(p => p.Add(1)).Return(2);

            //Act
            proc.Inc();
            int step1 = proc.Register;
            proc.Inc();
            int step2 = proc.Register;

            //Assert
            Assert.AreEqual(1, step1);
            Assert.AreEqual(2, step2);
            proc.VerifyAllExpectations();
        }

66. Example

View license
[Test]
        public void AbuseArrayList_UsingGenerateStub()
        {
            ArrayList list = MockRepository.GenerateStub<ArrayList>();

            // Evaluate the values from the mock
            Assert.AreEqual(0, list.Capacity);
        }

67. Example

View license
[Test]
        public void AbuseArrayList_UsingCreateMockGenerics_AAA()
        {
            //Arrange
            ArrayList list = MockRepository.GenerateStrictMock<ArrayList>();

            //Act
            // Setup the expectation of a call on the mock
            list.Expect(l => l.Capacity).Return(999);

            int capacity = list.Capacity;

            //Assert
            // Evaluate the values from the mock
            Assert.AreEqual(999, capacity);
            list.VerifyAllExpectations();
        }

68. Example

View license
[Test]
        public void MockAGenericInterface_AAA()
        {
            //Arrange
            IList<int> list = MockRepository.GenerateStrictMock<IList<int>>();
            list.Expect(l => l.Count).Return(5);

            //Act
            int count = list.Count;

            //Assert
            Assert.AreEqual(5, count);
            list.VerifyAllExpectations();
        }

69. Example

View license
[Test]
        public void setPropertyReturnValue_AAA()
        {
            //Arrange
            IList list = MockRepository.GenerateStrictMock<IList>();
            list.Expect(l => l.Count).Return(42).Repeat.Any();

            //Act
            int count = list.Count;

            //Assert
            Assert.AreEqual(42, count);
        }

70. Example

Project: faker-cs
Source File: LoremFixture.cs
View license
[Test]
        public void Should_Return_Word_List()
        {
            var words = Lorem.Words(10);
            Assert.AreEqual(10, words.Count());
        }

71. Example

View license
[Test]
        public void Should_Invoke_Func_Given_Number_Of_Times()
        {
            var numbers = 10.Times(x => x);
            Assert.AreEqual(10, numbers.Count());
        }

72. Example

Project: faker-cs
Source File: ArrayExtensionsFixture.cs
View license
[Test]
        public void Should_Return_All_Array_Items()
        {
            var input = new[] {"a", "b", "c"};
            var result = 100.Times(x => input.Random());
            
            Assert.AreEqual(3, result.Distinct().Count());
        }

73. Example

View license
[Test]
        public void TestRemoveEntityRemovesAllComponents()
        {
            int removedComponents = 0;
            this.entityManager.RegisterComponentListeners<TestEntityComponent>(
                (id, component) => { },
                (id, component) => { ++removedComponents; });

            int entityId = this.entityManager.CreateEntity();
            this.entityManager.AddComponent<TestEntityComponent>(entityId);
            this.entityManager.RemoveEntity(entityId);
            this.entityManager.CleanUpEntities();

            Assert.AreEqual(1, removedComponents);
        }

74. Example

View license
[Test]
        public void TestEntityRemovedWhenRemovingWholeEntity()
        {
            var entityManager = new EntityManager(new EventManager());

            // Create compound entities.
            var compoundEntities = new CompoundEntities<TestCompound>(entityManager);
            var eventCount = 0;
            compoundEntities.EntityRemoved += (id, entity) => { ++eventCount; };

            // Add entity with required components.
            var entityId = entityManager.CreateEntity();
            entityManager.InitEntity(
                entityId,
                new IEntityComponent[] { new TestCompoundComponentA(), new TestCompoundComponentB() });

            // Now remove entity.
            entityManager.RemoveEntity(entityId);
            entityManager.CleanUpEntities();

            Assert.AreEqual(1, eventCount);
        }

75. Example

View license
[Test]
        public void TestValidEntityWithOptionalCompAddedTriggerEventOnlyOnce()
        {
            var entityManager = new EntityManager(new EventManager());

            // Create compound entities.
            var compoundEntities = new CompoundEntities<TestCompoundWithOneOptionalComp>(entityManager);
            var entityAddedEvent = 0;
            compoundEntities.EntityAdded += (id, entity) => { ++entityAddedEvent; };

            // Add required and optional component.
            var entityId = entityManager.CreateEntity();
            entityManager.InitEntity(
                entityId,
                new IEntityComponent[] { new TestCompoundComponentA(), new TestCompoundComponentB() });

            Assert.AreEqual(1, entityAddedEvent);
        }

76. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test32BitIntOne()
        {
            unchecked
            {
                Int32 intIn = (Int32)0xFFFFFFFF;

                DatagramWriter writer = new DatagramWriter();
                writer.Write(intIn, 32);

                DatagramReader reader = new DatagramReader(writer.ToByteArray());
                Int32 intOut = reader.Read(32);

                Assert.AreEqual(intIn, intOut);
            }
        }

77. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test32BitInt()
        {
            unchecked
            {
                Int32 intIn = (Int32)0x87654321;

                DatagramWriter writer = new DatagramWriter();
                writer.Write(intIn, 32);

                DatagramReader reader = new DatagramReader(writer.ToByteArray());
                Int32 intOut = reader.Read(32);

                Assert.AreEqual(intIn, intOut);
            }
        }

78. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test16BitInt()
        {
            Int32 intIn = (Int32)0x00004321;

            DatagramWriter writer = new DatagramWriter();
            writer.Write(intIn, 16);

            DatagramReader reader = new DatagramReader(writer.ToByteArray());
            Int32 intOut = reader.Read(16);

            Assert.AreEqual(intIn, intOut);
        }

79. Example

Project: CoAP.NET
Source File: MemoryLeakingMapTest.cs
View license
public void AssertMapsEmpty()
        {
            Assert.AreEqual(0, _exchangesByID.Count);
            Assert.AreEqual(0, _exchangesByToken.Count);
            Assert.AreEqual(0, _ongoingExchanges.Count);
            Assert.AreEqual(0, _incommingMessages.Count);
        }

80. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test4BitInt()
        {
            Int32 intIn = 0x0000005;

            DatagramWriter writer = new DatagramWriter();
            writer.Write(intIn, 4);

            DatagramReader reader = new DatagramReader(writer.ToByteArray());
            Int32 intOut = reader.Read(4);

            Assert.AreEqual(intIn, intOut);
        }

81. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test1BitInt()
        {
            Int32 intIn = 0x00000001;

            DatagramWriter writer = new DatagramWriter();
            writer.Write(intIn, 1);

            DatagramReader reader = new DatagramReader(writer.ToByteArray());
            Int32 intOut = reader.Read(1);

            Assert.AreEqual(intIn, intOut);
        }

82. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test32BitIntZero()
        {
            Int32 intIn = (Int32)0x00000000;

            DatagramWriter writer = new DatagramWriter();
            writer.Write(intIn, 32);

            DatagramReader reader = new DatagramReader(writer.ToByteArray());
            Int32 intOut = reader.Read(32);

            Assert.AreEqual(intIn, intOut);
        }

83. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test2BitInt()
        {
            Int32 intIn = 0x00000002;

            DatagramWriter writer = new DatagramWriter();
            writer.Write(intIn, 2);

            DatagramReader reader = new DatagramReader(writer.ToByteArray());
            Int32 intOut = reader.Read(2);

            Assert.AreEqual(intIn, intOut);
        }

84. Example

Project: CoAP.NET
Source File: DatagramReadWriteTest.cs
View license
[TestMethod]
        public void Test8BitInt()
        {
            Int32 intIn = 0x00000021;

            DatagramWriter writer = new DatagramWriter();
            writer.Write(intIn, 8);

            DatagramReader reader = new DatagramReader(writer.ToByteArray());
            Int32 intOut = reader.Read(8);

            Assert.AreEqual(intIn, intOut);
        }

85. Example

View license
[Test]
        public void Test_SampleLazy_TestCase()
        {
            StreamSink<char> s = Stream.CreateSink<char>();
            DiscreteCell<char> c = s.Hold('a');
            Lazy<char> sample1 = c.Cell.SampleLazy();
            s.Send('b');
            Lazy<char> sample2 = c.Cell.SampleLazy();
            Assert.AreEqual('a', sample1.Value);
            Assert.AreEqual('b', sample2.Value);
        }

86. Example

Project: sodium
Source File: TransactionTests.cs
View license
[Test]
        public void PostInNestedConstructTransaction2()
        {
            int value = 0;
            Transaction.RunConstruct(() =>
            {
                StreamSink<int> s = Stream.CreateSink<int>();
                s.Send(2);
                Transaction.RunConstruct(() =>
                {
                    DiscreteCell<int> c = s.Hold(1);
                    Transaction.Post(() => value = c.Cell.Sample());
                    return Unit.Value;
                });
                Assert.AreEqual(value, 0);
                return Unit.Value;
            });

            Assert.AreEqual(value, 2);
        }

87. Example

Project: sodium
Source File: TransactionTests.cs
View license
[Test]
        public void PostInTransaction()
        {
            int value = 0;
            Transaction.RunVoid(() =>
            {
                StreamSink<int> s = Stream.CreateSink<int>();
                s.Send(2);
                DiscreteCell<int> c = s.Hold(1);
                Transaction.Post(() => value = c.Cell.Sample());
                Assert.AreEqual(value, 0);
            });

            Assert.AreEqual(value, 2);
        }

88. Example

Project: sodium
Source File: TransactionTests.cs
View license
[Test]
        public void PostInNestedTransaction2()
        {
            int value = 0;
            Transaction.RunVoid(() =>
            {
                StreamSink<int> s = Stream.CreateSink<int>();
                s.Send(2);
                Transaction.RunConstruct(() =>
                {
                    DiscreteCell<int> c = s.Hold(1);
                    Transaction.Post(() => value = c.Cell.Sample());
                    return Unit.Value;
                });
                Assert.AreEqual(value, 0);
            });

            Assert.AreEqual(value, 2);
        }

89. Example

Project: sodium
Source File: TransactionTests.cs
View license
[Test]
        public void PostInNestedTransaction()
        {
            int value = 0;
            Transaction.RunVoid(() =>
            {
                StreamSink<int> s = Stream.CreateSink<int>();
                s.Send(2);
                Transaction.RunVoid(() =>
                {
                    DiscreteCell<int> c = s.Hold(1);
                    Transaction.Post(() => value = c.Cell.Sample());
                });
                Assert.AreEqual(value, 0);
            });

            Assert.AreEqual(value, 2);
        }

90. Example

Project: sodium
Source File: CellTests.cs
View license
[Test]
        public async Task TestListenOnceAsync()
        {
            CellSink<int> c = Cell.CreateSink(9);
            int result = await Transaction.Run(() => Operational.Value(c).ListenOnceAsync());
            c.Send(2);
            c.Send(7);
            Assert.AreEqual(9, result);
        }

91. Example

Project: sodium
Source File: TransactionTests.cs
View license
[Test]
        public void PostInNestedConstructTransaction()
        {
            int value = 0;
            Transaction.RunConstruct(() =>
            {
                StreamSink<int> s = Stream.CreateSink<int>();
                s.Send(2);
                Transaction.RunVoid(() =>
                {
                    DiscreteCell<int> c = s.Hold(1);
                    Transaction.Post(() => value = c.Cell.Sample());
                });
                Assert.AreEqual(value, 0);
                return Unit.Value;
            });

            Assert.AreEqual(value, 2);
        }

92. Example

Project: sodium
Source File: TransactionTests.cs
View license
[Test]
        public void Post()
        {
            DiscreteCell<int> cell = Transaction.Run(() =>
            {
                StreamSink<int> s = Stream.CreateSink<int>();
                s.Send(2);
                return s.Hold(1);
            });
            int value = 0;
            Transaction.Post(() => value = cell.Cell.Sample());

            Assert.AreEqual(value, 2);
        }

93. Example

Project: sodium
Source File: StreamTests.cs
View license
[Test]
        public async Task TestListenOnceAsyncSameThread()
        {
            StreamSink<char> s = Stream.CreateSink<char>();
            TaskWithListener<char> t = s.ListenOnceAsync();
            s.Send('A');
            s.Send('B');
            s.Send('C');
            char r = await t;
            Assert.AreEqual('A', r);
        }

94. Example

Project: sodium
Source File: MaybeTests.cs
View license
[Test]
        public void TestNone()
        {
            Maybe<int> m = Maybe.None;

            int n = m.Match(v => v, () => 0);

            Assert.AreEqual(0, n);
        }

95. Example

Project: sodium
Source File: MaybeTests.cs
View license
[Test]
        public void TestSome()
        {
            Maybe<int> m = Maybe.Some(2);

            int n = m.Match(v => v, () => 0);

            Assert.AreEqual(2, n);
        }

96. Example

Project: sodium
Source File: TransactionTests.cs
View license
[Test]
        public void PostInConstructTransaction()
        {
            int value = 0;
            Transaction.RunConstruct(() =>
            {
                StreamSink<int> s = Stream.CreateSink<int>();
                s.Send(2);
                DiscreteCell<int> c = s.Hold(1);
                Transaction.Post(() => value = c.Cell.Sample());
                Assert.AreEqual(value, 0);
                return Unit.Value;
            });

            Assert.AreEqual(value, 2);
        }

97. Example

View license
[Test]
        public void Test_Sample_TestCase()
        {
            StreamSink<char> s = Stream.CreateSink<char>();
            DiscreteCell<char> c = s.Hold('a');
            char sample1 = c.Cell.Sample();
            s.Send('b');
            char sample2 = c.Cell.Sample();
            Assert.AreEqual('a', sample1);
            Assert.AreEqual('b', sample2);
        }

98. Example

Project: cspacman
Source File: NavigationTest.cs
View license
[Test]
		public void testShortestPathEmpty() {
			IBoard b = parser.ParseMap(new List<string>(new string[] {" "})).Board;
			Square s1 = b.SquareAt(0, 0);
			Square s2 = b.SquareAt(0, 0);
			IList<Direction> path = Navigation
				.shortestPath(s1, s2, new Mock<Unit>().Object);
			Assert.AreEqual(0, path.Count);
		}

99. Example

Project: SharpDB
Source File: DBTests.cs
View license
[Test]
		public void ReadOldRevisionDuringTransaction()
		{
			DocumentId id1 = new DocumentId("1");

			m_db.Update(id1, new byte[1] { 0 });

			int transactionId = m_db.StartTransaction();

			m_db.Update(id1, new byte[1] { 1 });

			byte[] blob = m_db.TransactionGet(transactionId, id1);

			Assert.AreEqual(0, blob[0]);

			m_db.CommitTransaction(transactionId);

			transactionId = m_db.StartTransaction();

			blob = m_db.TransactionGet(transactionId, id1);

			Assert.AreEqual(1, blob[0]);

			m_db.CommitTransaction(transactionId);
		}

100. Example

Project: SharpDB
Source File: GetUpdateDeleteSteps.cs
View license
[Then(@"Document with key=(.*) should not exist")]
		public void ThenDocumentWithKeyShouldNotExist(int key)
		{
			byte[] valueBytes = m_databaseContext.Database.Get(new DocumentId(key));

			Assert.AreEqual(0, valueBytes.Length);
		}