public void SerelizeEmptyScrbe() { var c = new ScruptureCollection(); var s = new ScripeEmpty(); var s2 = Transfare(c, s); Assert.IsTrue(s2.IsFrozen); }
public void SerelizeMultipleSub() { var sub1 = new ScripePropertysOnly() { Secret = "Secret", ShouldBeSerelized = 1, ShouldNotBeSerelized = 2 }; var sub2 = new ScripeEmpty(); var parent = new ScrupeWithCollectionSub(); parent.Childs.Add(sub1); parent.Childs.Add(sub2); var c = new ScruptureCollection(); var parent2 = Transfare(c, parent); Assert.IsTrue(parent2.Childs.Count == 2); Assert.IsTrue(parent2.Childs[0] is ScripePropertysOnly); Assert.IsTrue(parent2.Childs[1] is ScripeEmpty); Assert.AreEqual(sub1.ShouldBeSerelized, (parent2.Childs[0] as ScripePropertysOnly).ShouldBeSerelized); Assert.AreEqual(default(int), (parent2.Childs[0] as ScripePropertysOnly).ShouldNotBeSerelized); Assert.AreEqual(default(string), (parent2.Childs[0] as ScripePropertysOnly).Secret); Assert.IsTrue(parent2.IsFrozen); Assert.IsTrue(parent2.Childs.All(x => x.IsFrozen)); }