public void StandardClassTest() { var model = new StandardClassModel { IntValue = 0x12345678, StringValue = "ABCDEFG" }; using (var ms = new MemoryStream()) { ms.WriteValue(model); Assert.IsTrue( ms.ToArray().SequenceEqual(new byte[] { 0x01, 0x78, 0x56, 0x34, 0x12, 0x07, 0x00, (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G' })); } }
public void StandardNonMemberDataContractClassTest() { var model = new StandardNonMemberDataContractClassModel { IntValue = 0x12345678, InternalIntValue = 0x76543210, StringValue = "ABCDEFG", InternalStringValue = "GFEDCBA" }; using (var ms = new MemoryStream()) { ms.WriteValue(model); Assert.IsTrue( ms.ToArray().SequenceEqual(new byte[] { 0x01, 0x10, 0x32, 0x54, 0x76, 0x07, 0x00, (byte)'G', (byte)'F', (byte)'E', (byte)'D', (byte)'C', (byte)'B', (byte)'A' })); } }