Exemple #1
0
        public void SerializeSuperLongArray()
        {
            var actual = new Protocol16Stream();

            float[] input = new float[short.MaxValue + 1];
            Assert.Throws <NotSupportedException>(
                () => { Protocol16Serializer.Serialize(actual, input, true); });
        }
Exemple #2
0
        public void SerializeSuperLongString()
        {
            var    actual = new Protocol16Stream();
            string input  = string.Empty.PadLeft(short.MaxValue + 1, '0');

            Assert.Throws <NotSupportedException>(
                () => { Protocol16Serializer.Serialize(actual, input, true); });
        }
Exemple #3
0
        private void TestSerializeMethod(byte[] expectedBytes, object obj)
        {
            var expected = new MemoryStream(expectedBytes);
            var actual   = new Protocol16Stream();

            Protocol16Serializer.Serialize(actual, obj, true);
            ToString(actual);
            Assert.AreEqual(expected, actual);
        }