public void EmptyClassDocument()
        {
            var root = new EmptyClass();
            var doc  = Serializer.Serialize(root, null);

            Assert.NotNull(doc);
            Assert.AreEqual("!Test.EmptyClass{}", doc);

            var readRoot = Serializer.Deserialize <EmptyClass>(doc, null);

            Assert.True(root.IsSame(readRoot));
        }
        public void EmptyClass()
        {
            var value = new EmptyClass();
            var w     = new Writer();
            var cs    = new ClassSerializer(typeof(EmptyClass));

            Assert.True(cs.Write(w, value, null));
            Assert.AreEqual("!Test.EmptyClass{}", w.ToString());

            var r      = new Reader(w.ToString());
            var result = cs.Read(r, null, null) as EmptyClass;

            Assert.IsNotNull(result);
            Assert.IsFalse(r.AnyLeft, "Any characters left.");
            Assert.IsTrue(value.IsSame(result), "Read back value is not the same.");
        }
Exemplo n.º 3
0
 public DerivedClass(bool init)
 {
     MyEmptyClass = init ? new DerivedClass(false) : null;
 }
Exemplo n.º 4
0
 public CascadedClass(PropertyClass myPropertyInstance)
 {
     MyEmptyClass    = new EmptyClass();
     MyPropertyClass = myPropertyInstance;
 }
Exemplo n.º 5
0
 public CascadedClass()
 {
     MyEmptyClass    = new EmptyClass();
     MyPropertyClass = new PropertyClass();
 }
Exemplo n.º 6
0
 public bool IsSame(EmptyClass other)
 {
     return(true);
 }