Beispiel #1
0
        public void StandardSealedClassTest()
        {
            var model = new StandardSealedClassModel
            {
                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 StandardSealedClassTest()
		{
			var model = new StandardSealedClassModel
			{
				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'
					}));
			}
		}