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

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

200 Examples 7

1. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void Bug575936Int32Int64Comparison()
		{
			long l64 = 0;
			int i32 = 0;
			Assert.AreEqual(i32, l64);
		}

2. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void Bug575936Int32Int64Comparison()
		{
			long l64 = 0;
			int i32 = 0;
			Assert.AreEqual(i32, l64);
		}

3. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void IntegerLongComparison()
		{
			Assert.AreEqual(1, 1L);
			Assert.AreEqual(1L, 1);
		}

4. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void IntegerLongComparison()
		{
			Assert.AreEqual(1, 1L);
			Assert.AreEqual(1L, 1);
		}

5. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void IntegerLongComparison()
		{
			Assert.AreEqual(1, 1L);
			Assert.AreEqual(1L, 1);
		}

6. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void Bug575936Int32Int64Comparison()
		{
			long l64 = 0;
			int i32 = 0;
			Assert.AreEqual(i32, l64);
		}

7. Example

View license
[Test]
            public void Should_map_to_projection()
            {
                // Arrange
                var message = new TestMessage {MessageProperty = 777};
                var projection = new TestProjection();
                var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>();
                builder.Map(p => p.ProjectionProperty, e => e.MessageProperty);

                // Act
                builder.Mappers.Map(message, projection);

                // Assert
                Assert.AreEqual(message.MessageProperty, projection.ProjectionProperty);
            }

8. Example

View license
[Test]
            public void Should_substract_from_projection()
            {
                // Arrange
                var message = new TestMessage {MessageProperty = 5};
                var projection = new TestProjection {ProjectionProperty = 15};
                var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>();
                builder.Substract(p => p.ProjectionProperty, e => e.MessageProperty);

                // Act
                builder.Mappers.Map(message, projection);

                // Assert
                Assert.AreEqual(10, projection.ProjectionProperty);
            }

9. Example

View license
[Test]
            public void Should_decrement_projection()
            {
                // Arrange
                var message = new TestMessage();
                var projection = new TestProjection {ProjectionProperty = 5};
                var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>();
                builder.Decrement(p => p.ProjectionProperty);

                // Act
                builder.Mappers.Map(message, projection);

                // Assert
                Assert.AreEqual(4, projection.ProjectionProperty);
            }

10. Example

View license
[Test]
            public void Should_update_with_new_values()
            {
                Assert.AreEqual(888, _targetProvider.UpdateProjection.ValueInt64);
            }

11. Example

View license
[Test]
            public void Should_set_to_projection()
            {
                // Arrange
                var message = new TestMessage();
                var projection = new TestProjection();
                var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>();
                builder.Set(p => p.ProjectionProperty, 555);

                // Act
                builder.Mappers.Map(message, projection);

                // Assert
                Assert.AreEqual(555, projection.ProjectionProperty);
            }

12. Example

View license
[Test]
            public void Should_add_to_projection()
            {
                // Arrange
                var message = new TestMessage {MessageProperty = 5};
                var projection = new TestProjection {ProjectionProperty = 5};
                var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>();
                builder.Add(p => p.ProjectionProperty, e => e.MessageProperty);

                // Act
                builder.Mappers.Map(message, projection);

                // Assert
                Assert.AreEqual(10, projection.ProjectionProperty);
            }

13. Example

View license
[Test]
            public void Should_do_lambda_expression()
            {
                // Arrange
                var message = new TestMessage {MessageProperty = 5};
                var projection = new TestProjection {ProjectionProperty = 5};
                var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>();
                builder.Do((e, p) => p.ProjectionProperty = p.ProjectionProperty*e.MessageProperty);

                // Act
                builder.Mappers.Map(message, projection);

                // Assert
                Assert.AreEqual(25, projection.ProjectionProperty);
            }

14. Example

View license
[Test]
            public void Should_increment_projection()
            {
                // Arrange
                var message = new TestMessage();
                var projection = new TestProjection {ProjectionProperty = 5};
                var builder = new AddNewProjectionStrategyArguments<TestMessage, TestProjection>();
                builder.Increment(p => p.ProjectionProperty);

                // Act
                builder.Mappers.Map(message, projection);

                // Assert
                Assert.AreEqual(6, projection.ProjectionProperty);
            }

15. Example

View license
[Then(@"the JSON fragment should be validated as a valid JSON property name")]
        public void ThenTheJSONFragmentShouldBeValidatedAsAValidJSONPropertyName() {
            Assert.AreEqual(36, _results[0]);
        }

16. Example

Project: IntXLib
Source File: ExplicitConvertOpTest.cs
View license
[Test]
		public void ConvertToLong()
		{
			long n = 1234567890123456789;
			IntX intX = n;
			Assert.AreEqual(n, (long)intX);

			n = -n;
			intX = n;
			Assert.AreEqual(n, (long)intX);

			n = 0;
			intX = n;
			Assert.AreEqual(n, (long)intX);

			uint un = 1234567890;
			n = (long)(un | (ulong)un << 32);
			intX = new IntX(new uint[] { un, un, un, un, un }, false);
			Assert.AreEqual(n, (long)intX);
			intX = new IntX(new uint[] { un, un, un, un, un }, true);
			Assert.AreEqual(-n, (long)intX);

			int ni = 1234567890;
			n = ni;
			intX = ni;
			Assert.AreEqual(n, (long)intX);
		}

17. Example

View license
[Test]
        public void TestGetPosition00()
        {
            //Assert MemoryStream cursor position before/after seek operation.
            //
            IStorage storage = new BinaryStorage();
            long beforeSeek = storage.GetPosition();
            Assert.AreEqual(0, beforeSeek);

            storage.Seek(4, SeekOrigin.Current);
            long afterSeek = storage.GetPosition();
            Assert.AreEqual(4, afterSeek);
        }

18. Example

View license
[Test]
        public void TestGetPosition02()
        {
            //Assert MemoryStream cursor position before/after write operation.
            //
            IStorage storage = new BinaryStorage();
            long beforeWrite = storage.GetPosition();
            Assert.AreEqual(0, beforeWrite);

            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', 'D', 'B', 'L');
            storage.WriteDouble(signature, 1.20);
            long afterWrite = storage.GetPosition();
            Assert.AreEqual(16, afterWrite);
        }

19. Example

View license
[Test]
        public void TestReadWriteLong02()
        {
            //Functionality test on ReadLong(ulong expectedSignature, long defaultValue) and WriteLong(ulong signature, long value)
            //Default value expected due to unmatched signature.
            //
            IStorage storage = new BinaryStorage();
            ulong signature00 = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', 'L', 'N', 'G');
            ulong signature01 = Utilities.MakeEightCC('T', 'E', 'S', 'T', '_', 'L', 'N', 'G');

            storage.WriteLong(signature00, 3000000000);
            long position = storage.GetPosition();
            Assert.AreEqual(16, position);

            storage.Seek(0, SeekOrigin.Begin);
            long returned = storage.ReadLong(signature01, 3000000001);
            Assert.AreEqual(3000000001, returned);
        }

20. Example

View license
[Test]
        public void TestReadWriteLong03()
        {
            //Functionality test on ReadLong(ulong expectedSignature, long defaultValue) and WriteLong(ulong signature, long value)
            //Initial value expected since matched signature.
            //
            IStorage storage = new BinaryStorage();
            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', 'L', 'N', 'G');

            storage.WriteLong(signature, 3000000000);
            long position = storage.GetPosition();
            Assert.AreEqual(16, position);

            storage.Seek(0, SeekOrigin.Begin);
            long returned = storage.ReadLong(signature, 3000000001);
            Assert.AreEqual(3000000000, returned);
        }

21. Example

View license
[Test]
        public void TestReadWriteLong01()
        {
            //Functionality test on ReadLong(ulong expectedSignature) and WriteLong(ulong signature, long value)
            //Initial value expected since matched signature.
            //
            IStorage storage = new BinaryStorage();
            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', 'L', 'N', 'G');

            storage.WriteLong(signature, 3000000000);
            long position = storage.GetPosition();
            Assert.AreEqual(16, position);

            storage.Seek(0, SeekOrigin.Begin);
            long returned = storage.ReadLong(signature);
            Assert.AreEqual(3000000000, returned);
        }

22. Example

View license
[Test]
        public void TestGetPosition01()
        {
            //Assert MemoryStream cursor position before/after read operation.
            //MemoryStream needs to be written before reading, hence the involvement of write operation in this test.
            //
            IStorage storage = new BinaryStorage();
            long beforeRead = storage.GetPosition();
            Assert.AreEqual(0, beforeRead);

            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', 'I', 'N', 'T');
            storage.WriteInteger(signature, 12);
            storage.Seek(-12, SeekOrigin.End);
            storage.ReadInteger(signature);
            long afterRead = storage.GetPosition();
            Assert.AreEqual(12, afterRead);
        }

23. Example

Project: Tempest
Source File: MessageExtensions.cs
View license
public static T AssertLengthMatches<T> (this T self)
			where T : Message, new()
		{
			if (self == null)
				throw new ArgumentNullException ("self");

			var stream = new MemoryStream (20480);
			var writer = new StreamValueWriter (stream);
			var reader = new StreamValueReader (stream);

			var msg = new T();
			var context = SerializationContextTests.GetContext (msg.Protocol);

			self.WritePayload (context, writer);
			long len = stream.Position;
			stream.Position = 0;

			msg.ReadPayload (context, reader);
			Assert.AreEqual (len, stream.Position);

			return msg;
		}

24. Example

Project: nesper
Source File: TestInfraExecuteQuery.cs
View license
private void RunQueryAssertCount(string epl, int count, string indexName, string backingClass) {
            _epService.EPRuntime.ExecuteQuery(epl);
            Assert.AreEqual(count, MyInfraCount);
            SupportQueryPlanIndexHook.AssertFAFAndReset(indexName, backingClass);
        }

25. Example

View license
public void AssertLong(long value)
            {
                Assert.AreEqual(expected, value);
            }

26. Example

View license
[Test]
        public void reading_from_the_stream_with_StreamCopyTo_returns_all_data()
        {
            BufferPoolStream stream = new BufferPoolStream(BufferPool);
            int size = 20123;
            stream.Write(new byte[size], 0, size);
            stream.Position = 0;

            var destination = new MemoryStream();
            stream.CopyTo(destination);
            Assert.AreEqual(destination.Length, size);
        }

27. Example

View license
[Test]
		public void Commit()
		{
			using (var conn = new SQLiteConnection(m_csb.ConnectionString))
			{
				conn.Open();
				conn.Execute("create table Test (Id int primary key);");

				using (var trans = conn.BeginTransaction())
				{
					conn.Execute("insert into Test(Id) values(1)", transaction: trans);
					trans.Commit();
				}

				using (var cmd = new SQLiteCommand(@"select count(Id) from Test", conn))
					Assert.AreEqual(1L, (long) cmd.ExecuteScalar());
			}
		}

28. Example

View license
[Test]
		public void Rollback()
		{
			using (var conn = new SQLiteConnection(m_csb.ConnectionString))
			{
				conn.Open();
				conn.Execute("create table Test (Id int primary key);");

				using (var trans = conn.BeginTransaction())
				{
					conn.Execute("insert into Test(Id) values(1)", transaction: trans);
					trans.Rollback();
				}

				using (var cmd = new SQLiteCommand(@"select count(Id) from Test", conn))
					Assert.AreEqual(0L, (long) cmd.ExecuteScalar());
			}
		}

29. Example

View license
[Test]
		public void Dispose()
		{
			using (var conn = new SQLiteConnection(m_csb.ConnectionString))
			{
				conn.Open();
				conn.Execute("create table Test (Id int primary key);");

				using (var trans = conn.BeginTransaction())
				{
					conn.Execute("insert into Test(Id) values(1)", transaction: trans);
				}

				using (var cmd = new SQLiteCommand(@"select count(Id) from Test", conn))
					Assert.AreEqual(0L, (long) cmd.ExecuteScalar());
			}
		}

30. Example

View license
[Test]
        public virtual void TestSkipBytes()
        {
            long s1 = _input.SkipBytes(-1);
            long s3 = _input.SkipBytes(1);
            Assert.AreEqual(0, s1);
            Assert.AreEqual(1, s3);
        }

31. Example

View license
[Test]
        public void ProcessingEmptyStreamShouldReturnEmptyStream()
        {
            var input = new MemoryStream();
            var output = new MemoryStream();

            TransmissionPeriodRemover.Process(input, output, 0);

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

32. Example

View license
[Test]
		public void LongMinValueTest()
		{
			PrimitiveExpression pe = ParseUtilCSharp.ParseExpression<PrimitiveExpression>("-9223372036854775808");
			Assert.AreEqual(-9223372036854775808, (long)pe.Value);
		}

33. Example

View license
[Test]
        public void Initialize_should_not_create_migration_table_if_it_exists()
        {
            //  arrange
            _subject.Initialize();

            //  act
            _subject.Initialize();

            //  assert
            long version;
            using (var helper = new SqlDatabaseHelper(TestConnectionString))
            {
                version = helper.ExecuteScalar<long>("SELECT COUNT(Version) FROM [schema_migrations]");
            }

            Assert.AreEqual(1, version);
        }

34. Example

View license
[Test]
        public void Initialize_should_create_migration_table()
        {
            //  act
            _subject.Initialize();

            //  assert
            long version;
            using (var helper = new SqlDatabaseHelper(TestConnectionString))
            {
                version = helper.ExecuteScalar<long>("SELECT COUNT(Version) FROM [schema_migrations]");
            }

            Assert.AreEqual(1, version);
        }

35. Example

Project: NsqSharp
Source File: ObjectExtensionsTest.cs
View license
[Test]
        public void CoerceIntToLong()
        {
            long result = 0.Coerce<long>();
            Assert.AreEqual(0, result);
            result = 123.Coerce<long>();
            Assert.AreEqual(123, result);
            result = -123.Coerce<long>();
            Assert.AreEqual(-123, result);
            result = int.MaxValue.Coerce<long>();
            Assert.AreEqual(int.MaxValue, result);
            result = int.MinValue.Coerce<long>();
            Assert.AreEqual(int.MinValue, result);
        }

36. Example

Project: MarcelloDB
Source File: BufferReaderTest.cs
View license
[Test]
        public void ReadInt64_Little_Endian()
        {
            var reader = new BufferReader(new byte[]
                {
                    0x11, 0x11, 0x22, 0x22,
                    0x33, 0x33, 0x44, 0x55,
                }, true);
            Int64 readInt = reader.ReadInt64();
            Assert.AreEqual(0x5544333322221111, readInt);
        }

37. Example

View license
[Test]
		public void TestOpExplicitInt64_Int64MaxValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( Int64.MaxValue ) );
			Assert.AreEqual( ( System.Int64 )( Int64.MaxValue ), result );
		}

38. Example

View license
[Test]
		public void TestOpExplicitInt64_Int32MaxValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( Int32.MaxValue ) );
			Assert.AreEqual( ( System.Int64 )( Int32.MaxValue ), result );
		}

39. Example

View license
[Test]
		public void TestOpExplicitInt64_SByteMinValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( SByte.MinValue ) );
			Assert.AreEqual( ( System.Int64 )( SByte.MinValue ), result );
		}

40. Example

View license
[Test]
		public void TestOpExplicitInt64_UInt16MaxValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( UInt16.MaxValue ) );
			Assert.AreEqual( ( System.Int64 )( UInt16.MaxValue ), result );
		}

41. Example

View license
[Test]
		public void TestOpExplicitInt64_SByteMaxValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( SByte.MaxValue ) );
			Assert.AreEqual( ( System.Int64 )( SByte.MaxValue ), result );
		}

42. Example

View license
[Test]
		public void TestOpExplicitInt64_Int16MaxValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( Int16.MaxValue ) );
			Assert.AreEqual( ( System.Int64 )( Int16.MaxValue ), result );
		}

43. Example

View license
[Test]
		public void TestOpExplicitInt64_UInt32MinValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( UInt32.MinValue ) );
			Assert.AreEqual( ( System.Int64 )( UInt32.MinValue ), result );
		}

44. Example

View license
[Test]
		public void TestOpExplicitInt64_Int16MinValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( Int16.MinValue ) );
			Assert.AreEqual( ( System.Int64 )( Int16.MinValue ), result );
		}

45. Example

View license
[Test]
		public void TestOpExplicitInt64_UInt32MaxValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( UInt32.MaxValue ) );
			Assert.AreEqual( ( System.Int64 )( UInt32.MaxValue ), result );
		}

46. Example

View license
[Test]
		public void TestOpExplicitInt64_UInt16MinValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( UInt16.MinValue ) );
			Assert.AreEqual( ( System.Int64 )( UInt16.MinValue ), result );
		}

47. Example

View license
[Test]
		public void TestOpExplicitInt64_Int64MinValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( Int64.MinValue ) );
			Assert.AreEqual( ( System.Int64 )( Int64.MinValue ), result );
		}

48. Example

View license
[Test]
		public void TestOpExplicitInt64_UInt64MinValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( UInt64.MinValue ) );
			Assert.AreEqual( ( System.Int64 )( UInt64.MinValue ), result );
		}

49. Example

View license
[Test]
		public void TestOpExplicitInt64_Int32MinValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( Int32.MinValue ) );
			Assert.AreEqual( ( System.Int64 )( Int32.MinValue ), result );
		}

50. Example

View license
[Test]
		public void TestOpExplicitInt64_ByteMaxValue_Success()
		{
			var result = ( System.Int64 )( new MessagePackObject( Byte.MaxValue ) );
			Assert.AreEqual( ( System.Int64 )( Byte.MaxValue ), result );
		}