public void DCClone() { System.Configuration.ConfigurationManager.AppSettings["CslaSerializationFormatter"] = "NetDataContractSerializer"; Assert.AreEqual( Csla.ApplicationContext.SerializationFormatters.NetDataContractSerializer, Csla.ApplicationContext.SerializationFormatter, "Formatter should be NetDataContractSerializer"); DCRoot root = new DCRoot(); root.Data = 123; DCRoot clone = root.Clone(); Assert.IsFalse(ReferenceEquals(root, clone), "Object instance should be different"); Assert.AreEqual(root.Data, clone.Data, "Data should match"); Assert.IsTrue(root.IsDirty, "Root IsDirty should be true"); Assert.IsTrue(clone.IsDirty, "Clone IsDirty should be true"); }
public void DCClone() { IDataPortal <DCRoot> dataPortal = _testDIContext.CreateDataPortal <DCRoot>(); System.Configuration.ConfigurationManager.AppSettings["CslaSerializationFormatter"] = "NetDataContractSerializer"; // TODO: NDCS has been dropped I think; is there a way to replicate this test with another formatter? //Assert.AreEqual( // Csla.ApplicationContext.SerializationFormatters.NetDataContractSerializer, // Csla.ApplicationContext.SerializationFormatter, // "Formatter should be NetDataContractSerializer"); DCRoot root = DCRoot.NewDCRoot(dataPortal); root.Data = 123; DCRoot clone = root.Clone(); Assert.IsFalse(ReferenceEquals(root, clone), "Object instance should be different"); Assert.AreEqual(root.Data, clone.Data, "Data should match"); Assert.IsTrue(root.IsDirty, "Root IsDirty should be true"); Assert.IsTrue(clone.IsDirty, "Clone IsDirty should be true"); }