Exemplo n.º 1
0
        public void TestSerializerEndianness()
        {
            var serializer = new BinarySerialization.BinarySerializer {Endianness = BinarySerialization.Endianness.Big};
            var expected = new EndiannessClass {Short = 1};

            var stream = new MemoryStream();
            serializer.Serialize(stream, expected);

            var data = stream.ToArray();

            Assert.AreEqual(0x1, data[1]);
        }
        public void SerializerEndiannessTest()
        {
            var serializer = new BinarySerializer {
                Endianness = BinarySerialization.Endianness.Big
            };
            var expected = new EndiannessClass {
                Short = 1
            };

            var stream = new MemoryStream();

            serializer.Serialize(stream, expected);

            var data = stream.ToArray();

            Assert.AreEqual(0x1, data[1]);
        }