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

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

200 Examples 7

1. Example

Project: Colore
Source File: ColorTests.cs
View license
[Test]
        public void ShouldImplicitCastToUint()
        {
            const uint Expected = 0x00010203;
            uint actual = new Color(0x00010203);
            Assert.AreEqual(Expected, actual);
        }

2. Example

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

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

			n = 1234567890;
			intX = new IntX(new uint[] { n, n, n }, false);
			Assert.AreEqual(n, (uint)intX);
		}

3. Example

View license
[Test]
        public void GetNextIdTest02()
        {
            // Test to make sure that "GetNextId" always increase id by '1'.
            IdGenerator generator = new IdGenerator();
            uint firstNodeId = generator.GetNextId(ComponentType.Node);
            uint firstSlotId = generator.GetNextId(ComponentType.Slot);
            uint firstEdgeId = generator.GetNextId(ComponentType.Edge);
            uint firstBubbleId = generator.GetNextId(ComponentType.Bubble);

            uint secondNodeId = generator.GetNextId(ComponentType.Node);
            uint secondSlotId = generator.GetNextId(ComponentType.Slot);
            uint secondEdgeId = generator.GetNextId(ComponentType.Edge);
            uint secondBubbleId = generator.GetNextId(ComponentType.Bubble);

            Assert.AreEqual(1, secondNodeId - firstNodeId);
            Assert.AreEqual(1, secondSlotId - firstSlotId);
            Assert.AreEqual(1, secondEdgeId - firstEdgeId);
            Assert.AreEqual(1, secondBubbleId - firstBubbleId);
        }

4. Example

View license
[Test]
        public void TestModifierModifier()
        {
            Assert.AreEqual((uint)TextEditorCommand.Modifier.None, 0x00000000);
            Assert.AreEqual((uint)TextEditorCommand.Modifier.Shift, 0x00000001);
            Assert.AreEqual((uint)TextEditorCommand.Modifier.Control, 0x00000002);
            Assert.AreEqual((uint)TextEditorCommand.Modifier.Alt, 0x00000004);
            Assert.AreEqual((uint)TextEditorCommand.Modifier.LeftButtonDown, 0x00000008);
            Assert.AreEqual((uint)TextEditorCommand.Modifier.MiddleButtonDown, 0x000000010);
            Assert.AreEqual((uint)TextEditorCommand.Modifier.RightButtonDown, 0x000000020);
        }

5. Example

View license
[Test]
        public void SetStartIdTest01()
        {
            // Test to make sure the start id is properly set, and that 
            // trying to get the next id returns the next higher number.
            IdGenerator generator = new IdGenerator();
            uint maxNodeId = (((uint)ComponentType.Node) | 0x1234);
            uint maxSlotId = (((uint)ComponentType.Slot) | 0x4567);
            uint maxEdgeId = (((uint)ComponentType.Edge) | 0x69ab);
            uint maxBubbleId = (((uint)ComponentType.Bubble) | 0x89ab);

            generator.SetStartId(maxNodeId);
            generator.SetStartId(maxSlotId);
            generator.SetStartId(maxEdgeId);
            generator.SetStartId(maxBubbleId);

            uint nextNodeId = generator.GetNextId(ComponentType.Node);
            uint nextSlotId = generator.GetNextId(ComponentType.Slot);
            uint nextEdgeId = generator.GetNextId(ComponentType.Edge);
            uint nextBubbleId = generator.GetNextId(ComponentType.Bubble);

            Assert.AreEqual(1, nextNodeId - maxNodeId);
            Assert.AreEqual(1, nextSlotId - maxSlotId);
            Assert.AreEqual(1, nextEdgeId - maxEdgeId);
            Assert.AreEqual(1, nextBubbleId - maxBubbleId);
        }

6. Example

View license
[Test]
        public void SteamIdTextToAccountId_NoFail()
        {
            string input = "STEAM_0:0:50024954";
            uint expected = 100049908;
            uint actual = IdConversions.SteamIdTextToAccountId(input);
            Assert.AreEqual(expected, actual);
        }

7. Example

View license
[Test]
        public void UlongToAccountId_NoFail()
        {
            ulong input = 76561198060315636;
            uint expected = 100049908;
            uint actual = IdConversions.UlongToAccountId(input);
            Assert.AreEqual(expected, actual);
        }

8. Example

Project: IdSharp
Source File: CRC32Test.cs
View license
[Test]
        public void CalculateInt32_Set1_ByteArray()
        {
            uint result = CRC32.CalculateInt32(_testByteArray_1);
            Assert.AreEqual(_crc32Result_1, result);
        }

9. Example

Project: IdSharp
Source File: CRC32Test.cs
View license
[Test]
        public void CalculateInt32_Set1_Stream()
        {
            using (Stream stream = new MemoryStream(_testByteArray_1))
            {
                uint result = CRC32.CalculateInt32(stream);
                Assert.AreEqual(_crc32Result_1, result);
            }
        }

10. Example

Project: IdSharp
Source File: CRC32Test.cs
View license
[Test]
        public void CalculateInt32_Set2_ByteArray()
        {
            uint result = CRC32.CalculateInt32(_testByteArray_2);
            Assert.AreEqual(_crc32Result_2, result);
        }

11. Example

Project: IdSharp
Source File: CRC32Test.cs
View license
[Test]
        public void CalculateInt32_Set2_Stream()
        {
            using (Stream stream = new MemoryStream(_testByteArray_2))
            {
                uint result = CRC32.CalculateInt32(stream);
                Assert.AreEqual(_crc32Result_2, result);
            }
        }

12. Example

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

13. Example

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

14. Example

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

15. Example

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

16. Example

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

17. Example

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

18. Example

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

19. Example

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

20. Example

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

21. Example

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

22. Example

Project: GlmSharp
Source File: uvec2.Test.cs
View license
[Test]
        public void StaticProperties()
        {
            Assert.AreEqual(0u, uvec2.Zero.x);
            Assert.AreEqual(0u, uvec2.Zero.y);
            
            Assert.AreEqual(1u, uvec2.Ones.x);
            Assert.AreEqual(1u, uvec2.Ones.y);
            
            Assert.AreEqual(1u, uvec2.UnitX.x);
            Assert.AreEqual(0u, uvec2.UnitX.y);
            
            Assert.AreEqual(0u, uvec2.UnitY.x);
            Assert.AreEqual(1u, uvec2.UnitY.y);
            
            Assert.AreEqual(uint.MaxValue, uvec2.MaxValue.x);
            Assert.AreEqual(uint.MaxValue, uvec2.MaxValue.y);
            
            Assert.AreEqual(uint.MinValue, uvec2.MinValue.x);
            Assert.AreEqual(uint.MinValue, uvec2.MinValue.y);
        }

23. Example

Project: GlmSharp
Source File: uvec2.Test.cs
View license
[Test]
        public void Constructors()
        {
            {
                var v = new uvec2(1u);
                Assert.AreEqual(1u, v.x);
                Assert.AreEqual(1u, v.y);
            }
            {
                var v = new uvec2(5u, 2u);
                Assert.AreEqual(5u, v.x);
                Assert.AreEqual(2u, v.y);
            }
            {
                var v = new uvec2(new uvec2(3u, 3u));
                Assert.AreEqual(3u, v.x);
                Assert.AreEqual(3u, v.y);
            }
            {
                var v = new uvec2(new uvec3(9u, 6u, 6u));
                Assert.AreEqual(9u, v.x);
                Assert.AreEqual(6u, v.y);
            }
            {
                var v = new uvec2(new uvec4(2u, 3u, 8u, 7u));
                Assert.AreEqual(2u, v.x);
                Assert.AreEqual(3u, v.y);
            }
        }

24. Example

Project: GlmSharp
Source File: uvec4.Test.cs
View license
[Test]
        public void StaticProperties()
        {
            Assert.AreEqual(0u, uvec4.Zero.x/n ..... /n //View Source file for more details /n }

25. Example

Project: GlmSharp
Source File: uvec3.Test.cs
View license
[Test]
        public void Constructors()
        {
            {
                var v = new uvec3(9u);
                Assert.AreEqual(9u, v.x);
                Assert.AreEqual(9u, v.y);
                Assert.AreEqual(9u, v.z);
            }
            {
                var v = new uvec3(6u, 5u, 2u);
                Assert.AreEqual(6u, v.x);
                Assert.AreEqual(5u, v.y);
                Assert.AreEqual(2u, v.z);
            }
            {
                var v = new uvec3(new uvec2(8u, 9u));
                Assert.AreEqual(8u, v.x);
                Assert.AreEqual(9u, v.y);
                Assert.AreEqual(0u, v.z);
            }
            {
                var v = new uvec3(new uvec3(6u, 3u, 2u));
                Assert.AreEqual(6u, v.x);
                Assert.AreEqual(3u, v.y);
                Assert.AreEqual(2u, v.z);
            }
            {
                var v = new uvec3(new uvec4(8u, 5u, 6u, 4u));
                Assert.AreEqual(8u, v.x);
                Assert.AreEqual(5u, v.y);
                Assert.AreEqual(6u, v.z);
            }
        }

26. Example

Project: GlmSharp
Source File: swizzle_uvec3.Test.cs
View license
[Test]
        public void RGBA()
        {
            {
                var ov = new uvec3(2u, 1u,/n ..... /n //View Source file for more details /n }

27. Example

Project: GlmSharp
Source File: swizzle_uvec3.Test.cs
View license
[Test]
        public void XYZW()
        {
            {
                var ov = new uvec3(6u, 4u,/n ..... /n //View Source file for more details /n }

28. Example

Project: GlmSharp
Source File: swizzle_uvec2.Test.cs
View license
[Test]
        public void XYZW()
        {
            {
                var ov = new uvec2(4u, 9u)/n ..... /n //View Source file for more details /n }

29. Example

Project: GlmSharp
Source File: swizzle_uvec4.Test.cs
View license
[Test]
        public void XYZW()
        {
            {
                var ov = new uvec4(4u, 1u,/n ..... /n //View Source file for more details /n }

30. Example

Project: GlmSharp
Source File: swizzle_uvec2.Test.cs
View license
[Test]
        public void RGBA()
        {
            {
                var ov = new uvec2(3u, 9u)/n ..... /n //View Source file for more details /n }

31. Example

Project: GlmSharp
Source File: swizzle_uvec4.Test.cs
View license
[Test]
        public void RGBA()
        {
            {
                var ov = new uvec4(6u, 8u,/n ..... /n //View Source file for more details /n }

32. Example

Project: GlmSharp
Source File: uvec3.Test.cs
View license
[Test]
        public void StaticProperties()
        {
            Assert.AreEqual(0u, uvec3.Zero.x);
            Assert.AreEqual(0u, uvec3.Zero.y);
            Assert.AreEqual(0u, uvec3.Zero.z);
            
            Assert.AreEqual(1u, uvec3.Ones.x);
            Assert.AreEqual(1u, uvec3.Ones.y);
            Assert.AreEqual(1u, uvec3.Ones.z);
            
            Assert.AreEqual(1u, uvec3.UnitX.x);
            Assert.AreEqual(0u, uvec3.UnitX.y);
            Assert.AreEqual(0u, uvec3.UnitX.z);
            
            Assert.AreEqual(0u, uvec3.UnitY.x);
            Assert.AreEqual(1u, uvec3.UnitY.y);
            Assert.AreEqual(0u, uvec3.UnitY.z);
            
            Assert.AreEqual(0u, uvec3.UnitZ.x);
            Assert.AreEqual(0u, uvec3.UnitZ.y);
            Assert.AreEqual(1u, uvec3.UnitZ.z);
            
            Assert.AreEqual(uint.MaxValue, uvec3.MaxValue.x);
            Assert.AreEqual(uint.MaxValue, uvec3.MaxValue.y);
            Assert.AreEqual(uint.MaxValue, uvec3.MaxValue.z);
            
            Assert.AreEqual(uint.MinValue, uvec3.MinValue.x);
            Assert.AreEqual(uint.MinValue, uvec3.MinValue.y);
            Assert.AreEqual(uint.MinValue, uvec3.MinValue.z);
        }

33. Example

Project: GlmSharp
Source File: uvec4.Test.cs
View license
[Test]
        public void Constructors()
        {
            {
                var v = new uvec4(1u);
                Assert.AreEqual(1u, v.x);
                Assert.AreEqual(1u, v.y);
                Assert.AreEqual(1u, v.z);
                Assert.AreEqual(1u, v.w);
            }
            {
                var v = new uvec4(0u, 2u, 0u, 8u);
                Assert.AreEqual(0u, v.x);
                Assert.AreEqual(2u, v.y);
                Assert.AreEqual(0u, v.z);
                Assert.AreEqual(8u, v.w);
            }
            {
                var v = new uvec4(new uvec2(1u, 5u));
                Assert.AreEqual(1u, v.x);
                Assert.AreEqual(5u, v.y);
                Assert.AreEqual(0u, v.z);
                Assert.AreEqual(0u, v.w);
            }
            {
                var v = new uvec4(new uvec3(0u, 0u, 1u));
                Assert.AreEqual(0u, v.x);
                Assert.AreEqual(0u, v.y);
                Assert.AreEqual(1u, v.z);
                Assert.AreEqual(0u, v.w);
            }
            {
                var v = new uvec4(new uvec4(2u, 6u, 2u, 1u));
                Assert.AreEqual(2u, v.x);
                Assert.AreEqual(6u, v.y);
                Assert.AreEqual(2u, v.z);
                Assert.AreEqual(1u, v.w);
            }
        }

34. Example

Project: SharpNav
Source File: MathHelperTests.cs
View license
[Test]
		public void Log2_PositiveIntegerUint_Success()
		{
			uint num = MathHelper.Log2((uint)65);

			Assert.AreEqual(num, 6);
		}

35. Example

Project: SharpNav
Source File: MathHelperTests.cs
View license
[Test]
		public void NextPowerOfTwo_PositiveIntegerUint_Sucess()
		{
			uint num = MathHelper.NextPowerOfTwo((uint)5);

			Assert.AreEqual(num, 8);
		}

36. Example

Project: packetnet
Source File: PpiFieldsTests.cs
View license
[Test]
            public void Test_PpiAggregation_Construction()
            {
                PpiAggregation field = new PpiAggregation(22);
                Assert.AreEqual(22, field.InterfaceId);
                
                PpiAggregation recreatedField = new PpiAggregation(new BinaryReader(new MemoryStream(field.Bytes)));
                
                Assert.AreEqual(22, recreatedField.InterfaceId);
            }

37. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void UInt() 
		{
			uint val = 1;
			uint expected = val;
			uint actual = val;

			Assert.IsTrue(expected == actual);
			Assert.AreEqual(expected, actual);
		}

38. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void UInt() 
		{
			uint val = 1;
			uint expected = val;
			uint actual = val;

			Assert.IsTrue(expected == actual);
			Assert.AreEqual(expected, actual);
		}

39. Example

Project: ContinuousTests
Source File: PdbTestBase.cs
View license
private static void AssertIteratorScopes(List<ILocalScope> originalScopes, List<ILocalScope> scopes)
		{
			AssertLists(originalScopes, scopes);

			for (int i = 0; i < (originalScopes ?? new List<ILocalScope>()).Count; i++)
			{
				Assert.AreEqual(originalScopes[i].Offset, scopes[i].Offset);
				Assert.AreEqual(originalScopes[i].Length, scopes[i].Length);
			}
		}

40. Example

Project: ContinuousTests
Source File: EqualsFixture.cs
View license
[Test]
		public void UInt() 
		{
			uint val = 1;
			uint expected = val;
			uint actual = val;

			Assert.IsTrue(expected == actual);
			Assert.AreEqual(expected, actual);
		}

41. Example

Project: OutlookPrivacyPlugin
Source File: JValueTests.cs
View license
[Test]
        public void ConvertsToUInt32()
        {
            Assert.AreEqual(UInt32.MaxValue, Convert.ToUInt32(new JValue(UInt32.MaxValue)));
        }

42. Example

View license
[Test]
        public void TestReadWriteUnsignedInteger03()
        {
            //Functionality test on ReadUnsignedInteger(ulong expectedSignature, uint defaultValue) and WriteUnsignedInteger(ulong signature, uint value)
            //Initial value expected since matched signature.
            //
            IStorage storage = new BinaryStorage();
            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', ' ', 'I', 'N', 'T');

            storage.WriteUnsignedInteger(signature, 2147483648);
            long position = storage.GetPosition();
            Assert.AreEqual(12, position);

            storage.Seek(0, SeekOrigin.Begin);
            uint returned = storage.ReadUnsignedInteger(signature, 2147483649);
            Assert.AreEqual(2147483648, returned);
        }

43. Example

View license
[Test]
        public void TestGetBackupFileIndex09()
        {
            // This test should pass.
            string name = "dss-backup-SSSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSSSSS-1024-4096.bin";
            int index = -1; uint graphId = uint.MaxValue;
            Utilities.GetBackupFileIndex(name, ref graphId, ref index);
            Assert.AreEqual(1024, graphId);
            Assert.AreEqual(4096, index);
        }

44. Example

View license
[Test]
        public void TestReadWriteUnsignedInteger01()
        {
            //Functionality test on ReadUnsignedInteger(ulong expectedSignature) and WriteUnsignedInteger(ulong signature, uint value)
            //Initial value expected since matched signature.
            //
            IStorage storage = new BinaryStorage();
            ulong signature = Utilities.MakeEightCC('T', 'E', 'S', 'T', 'U', 'I', 'N', 'T');

            storage.WriteUnsignedInteger(signature, 2147483648);
            long position = storage.GetPosition();
            Assert.AreEqual(12, position);

            storage.Seek(0, SeekOrigin.Begin);
            uint returned = storage.ReadUnsignedInteger(signature);
            Assert.AreEqual(2147483648, returned);
        }

45. Example

View license
[Test]
        public void TestReadWriteUnsignedInteger02()
        {
            //Functionality test on ReadUnsignedInteger(ulong expectedSignature, uint defaultValue) and WriteUnsignedInteger(ulong signature, uint value)
            //Default value expected due to unmatched signature.
            //
            IStorage storage = new BinaryStorage();
            ulong signature00 = Utilities.MakeEightCC('T', 'E', 'S', 'T', 'U', 'I', 'N', 'T');
            ulong signature01 = Utilities.MakeEightCC('T', 'E', 'S', 'T', '_', 'I', 'N', 'T');

            storage.WriteUnsignedInteger(signature00, 2147483648);
            long position = storage.GetPosition();
            Assert.AreEqual(12, position);

            storage.Seek(0, SeekOrigin.Begin);
            uint returned = storage.ReadUnsignedInteger(signature01, 2147483649);
            Assert.AreEqual(2147483649, returned);
        }

46. Example

View license
[Test]
        public void TestGetBackupFileIndex10()
        {
            // This test should pass even a full path with both additional hyphen and dot is provided.
            string name = @"C:\settings.config\user-data\dss-backup-SSSSSSSS-SSSS-SSSS-SSSS-SSSSSSSSSSSS-1024-4096.bin";
            int index = -1; uint graphId = uint.MaxValue;
            Utilities.GetBackupFileIndex(name, ref graphId, ref index);
            Assert.AreEqual(1024, graphId);
            Assert.AreEqual(4096, index);
        }

47. Example

Project: 32feet
Source File: IrdaNet.cs
View license
[Test]
            public void UInt32ParseHexBigNegative()
            {
                uint result = uint.Parse(StringB, System.Globalization.NumberStyles.HexNumber);
                uint expectedU = 0xFEDC00FF;
                //int expectedS = unchecked((int)expectedU);
                Assert.AreEqual(expectedU, result);
            }

48. Example

View license
[Test]
		public void IntMaxValueTest()
		{
			PrimitiveExpression pe = ParseUtilCSharp.ParseExpression<PrimitiveExpression>("2147483647");
			Assert.AreEqual(2147483647, (int)pe.Value);
			
			pe = ParseUtilCSharp.ParseExpression<PrimitiveExpression>("2147483648");
			Assert.AreEqual(2147483648, (uint)pe.Value);
		}

49. Example

Project: nunitlite
Source File: EqualsFixture.cs
View license
[Test]
		public void UInt() 
		{
			uint val = 1;
			uint expected = val;
			uint actual = val;

			Assert.IsTrue(expected == actual);
			Assert.AreEqual(expected, actual);
		}

50. Example

Project: nunit
Source File: AssertEqualsTests.cs
View license
[Test]
        public void UInt() 
        {
            uint val = 1;
            uint expected = val;
            uint actual = val;

            Assert.IsTrue(expected == actual);
            Assert.AreEqual(expected, actual);
        }