public void TestBigEndianSerializationForEveryUInt16() { Byte[] buffer = new Byte[2]; for (int i = UInt16.MinValue; i <= UInt16.MaxValue; i++) { UInt16 testValue = (UInt16)i; buffer.BigEndianSetUInt16(0, testValue); Assert.AreEqual((Byte)(testValue >> 8), buffer[0]); Assert.AreEqual((Byte)testValue, buffer[1]); Assert.AreEqual(testValue, buffer.BigEndianReadUInt16(0)); } }