예제 #1
0
파일: IOTests.cs 프로젝트: viethien/csla
        public void DeleteNewRoot()
        {
            Csla.ApplicationContext.GlobalContext.Clear();
            Csla.Test.Basic.Root root = Csla.Test.Basic.Root.NewRoot();

            Csla.ApplicationContext.GlobalContext.Clear();
            root.Delete();
            Assert.AreEqual(true, root.IsNew);
            Assert.AreEqual(true, root.IsDeleted);
            Assert.AreEqual(true, root.IsDirty);

            root = root.Save();
            Assert.IsNotNull(root);
            Assert.AreEqual(null, Csla.ApplicationContext.GlobalContext["Root"]);
            Assert.AreEqual(true, root.IsNew);
            Assert.AreEqual(false, root.IsDeleted);
            Assert.AreEqual(true, root.IsDirty);
        }
예제 #2
0
        public void DeleteNewRoot()
        {
            TestResults.Reinitialise();
            Csla.Test.Basic.Root root = NewRoot();

            TestResults.Reinitialise();
            root.Delete();
            Assert.AreEqual(true, root.IsNew);
            Assert.AreEqual(true, root.IsDeleted);
            Assert.AreEqual(true, root.IsDirty);

            root = root.Save();
            Assert.IsNotNull(root);
            Assert.AreEqual("", TestResults.GetResult("Root"));
            Assert.AreEqual(true, root.IsNew);
            Assert.AreEqual(false, root.IsDeleted);
            Assert.AreEqual(true, root.IsDirty);
        }