public void TestIPAddess() { WithIP obj = new WithIP { Address = IPAddress.Parse("100.90.80.100") }, clone = Serializer.DeepClone(obj); Assert.AreEqual(obj.Address, clone.Address); obj.Address = null; clone = Serializer.DeepClone(obj); Assert.IsNull(obj.Address, "obj"); Assert.IsNull(clone.Address, "clone"); }
static void Test(TypeModel model) { WithIP obj = new WithIP { Address = IPAddress.Parse("100.90.80.100") }, clone = (WithIP)model.DeepClone(obj); Assert.Equal(obj.Address, clone.Address); obj.Address = null; clone = (WithIP)model.DeepClone(obj); Assert.Null(obj.Address); //, "obj"); Assert.Null(clone.Address); //, "clone"); }
public void TestIPAddess() { var model = TypeModel.Create(); model.AllowParseableTypes = true; WithIP obj = new WithIP { Address = IPAddress.Parse("100.90.80.100") }, clone = (WithIP) model.DeepClone(obj); Assert.AreEqual(obj.Address, clone.Address); obj.Address = null; clone = (WithIP)model.DeepClone(obj); Assert.IsNull(obj.Address, "obj"); Assert.IsNull(clone.Address, "clone"); }
public void TestIPAddess() { var model = TypeModel.Create(); model.AllowParseableTypes = true; WithIP obj = new WithIP { Address = IPAddress.Parse("100.90.80.100") }, clone = (WithIP)model.DeepClone(obj); Assert.AreEqual(obj.Address, clone.Address); obj.Address = null; clone = (WithIP)model.DeepClone(obj); Assert.IsNull(obj.Address, "obj"); Assert.IsNull(clone.Address, "clone"); }