Пример #1
0
        public void TestNullBinderSerializationNull()
        {
            var tc = new TestClassWithNullField();

            tc.nullField = null;
            string r = new CompactSerializer().Serialize(tc);

            Assert.AreEqual("0&&", r);
            Assert.AreEqual(null, new CompactSerializer().Deserialize <TestClassWithNullField>(r).nullField);
        }
Пример #2
0
        public void TestNullBinderSerializationValue()
        {
            var tc = new TestClassWithNullField();

            tc.nullField = "Hello";
            string r = new CompactSerializer().Serialize(tc);

            Assert.AreEqual("1&Hello~&", r);
            Assert.AreEqual("Hello", new CompactSerializer().Deserialize <TestClassWithNullField>(r).nullField);
        }