Пример #1
0
 public void ListGetIsUndoEnabledAfterDeleteItemAndSave()
 {
     var cl = new TstClient();
     var root = cl.GetRoot<RootVM>();
     root.AItems.Remove(root.AItems.First());
     Assert.AreEqual(true, cl.GetIsUndoEnabled(root.Uid));
     cl.Save(root.Uid);
     Assert.AreEqual(false, cl.GetIsUndoEnabled(root.Uid));
 }
Пример #2
0
 public void GetIsUndoEnabledAfterChangesAndSave()
 {
     var cl = new TstClient();
     var a = cl.GetRoot<RootVM>().AItems.First();
     a.Value = 10;
     Assert.AreEqual(true, cl.GetIsUndoEnabled(a.Uid));
     cl.Save(a.Uid);
     Assert.AreEqual(false, cl.GetIsUndoEnabled(a.Uid));
 }
Пример #3
0
 public void ListGetIsUndoEnabledAfterAddItemAndSave()
 {
     var cl = new TstClient();
     var root = cl.GetRoot<RootVM>();
     root.AItems.Add(new Avm {Value = 99});
     Assert.AreEqual(true, cl.GetIsUndoEnabled(root.Uid));
     cl.Save(root.Uid);
     Assert.AreEqual(false, cl.GetIsUndoEnabled(root.Uid));
 }
Пример #4
0
        public void ListGetIsUndoEnabledAfterDeleteItemAndSave()
        {
            var cl   = new TstClient();
            var root = cl.GetRoot <RootVM>();

            root.AItems.Remove(root.AItems.First());
            Assert.AreEqual(true, cl.GetIsUndoEnabled(root.Uid));
            cl.Save(root.Uid);
            Assert.AreEqual(false, cl.GetIsUndoEnabled(root.Uid));
        }
Пример #5
0
        public void GetIsUndoEnabledAfterChangesAndSave()
        {
            var cl = new TstClient();
            var a  = cl.GetRoot <RootVM>().AItems.First();

            a.Value = 10;
            Assert.AreEqual(true, cl.GetIsUndoEnabled(a.Uid));
            cl.Save(a.Uid);
            Assert.AreEqual(false, cl.GetIsUndoEnabled(a.Uid));
        }
Пример #6
0
 public void Undo1()
 {
     var cl = new TstClient();
     var rt = cl.GetRoot<Root>();
     var cnt = rt.AItems.Count;
     rt.AItems.Add(new A {Value = 1});
     Assert.IsTrue(cl.GetIsUndoEnabled(rt.Uid));
     cl.Undo(rt.Uid);
     Assert.AreEqual(cnt, rt.AItems.Count);
     Assert.IsFalse(cl.GetIsUndoEnabled(rt.Uid));
 }
Пример #7
0
        public void ListGetIsUndoEnabledAfterAddItemAndSave()
        {
            var cl   = new TstClient();
            var root = cl.GetRoot <RootVM>();

            root.AItems.Add(new Avm {
                Value = 99
            });
            Assert.AreEqual(true, cl.GetIsUndoEnabled(root.Uid));
            cl.Save(root.Uid);
            Assert.AreEqual(false, cl.GetIsUndoEnabled(root.Uid));
        }
 public void GetParentIsUndoEnabledChanged()
 {
     var cl = new TstClient();
     var root = cl.GetRoot<Root>();
     root.Revert();
     var prnt = root.ParentItems.First();
     var chld = prnt.Children.First();
     Assert.AreEqual(false, cl.GetIsUndoEnabled(root));
     Assert.AreEqual(false, cl.GetIsUndoEnabled(prnt));
     chld.Value = 9.9;
     Assert.AreEqual(true, cl.GetIsUndoEnabled(prnt));
     Assert.AreEqual(true, cl.GetIsUndoEnabled(root));
 }
Пример #9
0
        public void Undo1()
        {
            var cl  = new TstClient();
            var rt  = cl.GetRoot <Root>();
            var cnt = rt.AItems.Count;

            rt.AItems.Add(new A {
                Value = 1
            });
            Assert.IsTrue(cl.GetIsUndoEnabled(rt.Uid));
            cl.Undo(rt.Uid);
            Assert.AreEqual(cnt, rt.AItems.Count);
            Assert.IsFalse(cl.GetIsUndoEnabled(rt.Uid));
        }
        public void GetRefIsUndoEnabledChanged()
        {
            var cl   = new TstClient();
            var root = cl.GetRoot <Root>();

            root.Revert();
            var refObject = root.RefItems.First();
            var a         = refObject.Ref;

            Assert.AreEqual(false, cl.GetIsUndoEnabled(root));
            Assert.AreEqual(false, cl.GetIsUndoEnabled(refObject));
            a.Value = 9;
            Assert.AreEqual(false, cl.GetIsUndoEnabled(refObject));
            Assert.AreEqual(true, cl.GetIsUndoEnabled(root));
        }
        public void GetParentIsUndoEnabledChanged()
        {
            var cl   = new TstClient();
            var root = cl.GetRoot <Root>();

            root.Revert();
            var prnt = root.ParentItems.First();
            var chld = prnt.Children.First();

            Assert.AreEqual(false, cl.GetIsUndoEnabled(root));
            Assert.AreEqual(false, cl.GetIsUndoEnabled(prnt));
            chld.Value = 9.9;
            Assert.AreEqual(true, cl.GetIsUndoEnabled(prnt));
            Assert.AreEqual(true, cl.GetIsUndoEnabled(root));
        }
Пример #12
0
        public void GetRootIsUndoEnabledByDefault()
        {
            var cl = new TstClient();
            var a  = cl.GetRoot <RootVM>().AItems.First();

            Assert.AreEqual(false, cl.GetIsUndoEnabled(a));
        }
Пример #13
0
        public void SaveAndUndo2()
        {
            var cl1 = new TstClient();
            var rt1 = cl1.GetRoot <Root>();

            var cl2 = new TstClient();
            var rt2 = cl2.GetRoot <Root>();

            var a1 = rt1.AItems.First();
            var a2 = rt2.AItems.First();

            var val = a1.Value;

            a2.Value = val + 2;
            a1.Value = val + 1;
            cl1.Save(a1);
            Assert.AreEqual(val + 2, a2.Value);
            cl2.Undo(a2);
            Assert.AreEqual(val, a2.Value);
            cl2.Undo(a2);
            Assert.AreEqual(val + 1, a2.Value);
            Assert.IsFalse(cl2.GetIsUndoEnabled(a2.Uid));
        }
 public void GetRefIsUndoEnabledChanged()
 {
     var cl = new TstClient();
     var root = cl.GetRoot<Root>();
     root.Revert();
     var refObject = root.RefItems.First();
     var a = refObject.Ref;
     Assert.AreEqual(false, cl.GetIsUndoEnabled(root));
     Assert.AreEqual(false, cl.GetIsUndoEnabled(refObject));
     a.Value = 9;
     Assert.AreEqual(false, cl.GetIsUndoEnabled(refObject));
     Assert.AreEqual(true, cl.GetIsUndoEnabled(root));
 }
Пример #15
0
 public void GetRootIsUndoEnabledByDefault()
 {
     var cl = new TstClient();
     var a = cl.GetRoot<RootVM>().AItems.First();
     Assert.AreEqual(false, cl.GetIsUndoEnabled(a));
 }
Пример #16
0
        public void SaveAndUndo2()
        {
            var cl1 = new TstClient();
            var rt1 = cl1.GetRoot<Root>();

            var cl2 = new TstClient();
            var rt2 = cl2.GetRoot<Root>();

            var a1 = rt1.AItems.First();
            var a2 = rt2.AItems.First();

            var val = a1.Value;
            a2.Value = val + 2;
            a1.Value = val + 1;
            cl1.Save(a1);
            Assert.AreEqual(val + 2, a2.Value);
            cl2.Undo(a2);
            Assert.AreEqual(val, a2.Value);
            cl2.Undo(a2);
            Assert.AreEqual(val + 1, a2.Value);
            Assert.IsFalse(cl2.GetIsUndoEnabled(a2.Uid));
        }