Beispiel #1
0
 public void Redo1()
 {
     var cl = new TstClient();
     var a = cl.GetRoot<Root>().AItems.First();
     var init = a.Value;
     a.Value = 10;
     a.Value = 20;
     cl.Undo(a.Uid);
     Assert.AreEqual(10, a.Value);
     cl.Undo(a.Uid);
     Assert.AreEqual(init, a.Value);
     cl.Redo(a.Uid);
     Assert.AreEqual(10, a.Value);
     cl.Redo(a.Uid);
     Assert.AreEqual(20, a.Value);
 }
Beispiel #2
0
        public void Redo2()
        {
            var cl   = new TstClient();
            var a    = cl.GetRoot <Root>().AItems.First();
            var init = a.Value;

            a.Value = 10;
            a.Value = init;
            cl.Undo(a.Uid);
            Assert.AreEqual(10, a.Value);
            cl.Undo(a.Uid);
            Assert.AreEqual(init, a.Value);
            cl.Redo(a.Uid);
            Assert.AreEqual(10, a.Value);
            cl.Redo(a.Uid);
            Assert.AreEqual(init, a.Value);
        }
Beispiel #3
0
        public void ListRedo1()
        {
            var cl = new TstClient();
            var root = cl.GetRoot<Root>();

            var cnt = root.AItems.Count;
            root.AItems.Add(new A {Value = 5});
            root.AItems.Last().Value = 10;
            cl.Undo(root.Uid);
            Assert.AreEqual(5, root.AItems.Last().Value);
            cl.Undo(root.Uid);
            Assert.AreEqual(cnt, root.AItems.Count);
            cl.Redo(root.Uid);
            Assert.AreEqual(cnt + 1, root.AItems.Count);
            Assert.AreEqual(5, root.AItems.Last().Value);
            cl.Redo(root.Uid);
            Assert.AreEqual(10, root.AItems.Last().Value);
        }
Beispiel #4
0
 public void AddUpdateAndRedo()
 {
     var cl = new TstClient();
     var root = cl.GetRoot<Root>();
     var cnt = root.BItems.Count;
     root.BItems.Add(new B {Value = "A"});
     root.BItems.Last().Value = "AA";
     cl.Undo(root.Uid);
     Assert.AreEqual("A", root.BItems.Last().Value);
     Assert.AreEqual(cnt + 1, root.BItems.Count);
     cl.Undo(root.Uid);
     Assert.AreEqual(cnt, root.BItems.Count);
     cl.Redo(root.Uid);
     Assert.AreEqual("A", root.BItems.Last().Value);
     Assert.AreEqual(cnt + 1, root.BItems.Count);
     cl.Redo(root.Uid);
     Assert.AreEqual("AA", root.BItems.Last().Value);
 }
 public void GetIsRedoEnabled0()
 {
     var cl = new TstClient();
     var a = cl.GetRoot<Root>().AItems.First();
     a.Value = 10;
     cl.Undo(a.Uid);
     Assert.AreEqual(true, cl.GetIsRedoEnabled(a.Uid));
     cl.Redo(a.Uid);
     Assert.AreEqual(false, cl.GetIsRedoEnabled(a.Uid));
 }
        public void GetIsRedoEnabled0()
        {
            var cl = new TstClient();
            var a  = cl.GetRoot <Root>().AItems.First();

            a.Value = 10;
            cl.Undo(a.Uid);
            Assert.AreEqual(true, cl.GetIsRedoEnabled(a.Uid));
            cl.Redo(a.Uid);
            Assert.AreEqual(false, cl.GetIsRedoEnabled(a.Uid));
        }
Beispiel #7
0
 public void Redo()
 {
     var cl = new TstClient();
     var pr = cl.GetRoot<Root>().ParentItems.First();
     var child = new Child {Value = 3.0};
     var cnt = pr.Children.Count;
     pr.Children.Add(child);
     cl.Undo(pr.Uid);
     Assert.AreEqual(cnt, pr.Children.Count);
     cl.Redo(pr.Uid);
     Assert.AreEqual(true, pr.Children.SingleOrDefault(_child => _child.Uid == child.Uid) != null);
 }
Beispiel #8
0
        public void ListRedo1()
        {
            var cl   = new TstClient();
            var root = cl.GetRoot <Root>();

            var cnt = root.AItems.Count;

            root.AItems.Add(new A {
                Value = 5
            });
            root.AItems.Last().Value = 10;
            cl.Undo(root.Uid);
            Assert.AreEqual(5, root.AItems.Last().Value);
            cl.Undo(root.Uid);
            Assert.AreEqual(cnt, root.AItems.Count);
            cl.Redo(root.Uid);
            Assert.AreEqual(cnt + 1, root.AItems.Count);
            Assert.AreEqual(5, root.AItems.Last().Value);
            cl.Redo(root.Uid);
            Assert.AreEqual(10, root.AItems.Last().Value);
        }
Beispiel #9
0
        public void AddUpdateAndRedo()
        {
            var cl   = new TstClient();
            var root = cl.GetRoot <Root>();
            var cnt  = root.BItems.Count;

            root.BItems.Add(new B {
                Value = "A"
            });
            root.BItems.Last().Value = "AA";
            cl.Undo(root.Uid);
            Assert.AreEqual("A", root.BItems.Last().Value);
            Assert.AreEqual(cnt + 1, root.BItems.Count);
            cl.Undo(root.Uid);
            Assert.AreEqual(cnt, root.BItems.Count);
            cl.Redo(root.Uid);
            Assert.AreEqual("A", root.BItems.Last().Value);
            Assert.AreEqual(cnt + 1, root.BItems.Count);
            cl.Redo(root.Uid);
            Assert.AreEqual("AA", root.BItems.Last().Value);
        }
Beispiel #10
0
        public void ListRedo()
        {
            var cl = new TstClient();
            var root = cl.GetRoot<Root>();

            var cnt = root.AItems.Count;
            root.AItems.Add(new A());

            cl.Undo(root.Uid);
            Assert.AreEqual(cnt, root.AItems.Count);

            cl.Redo(root.Uid);
            Assert.AreEqual(cnt + 1, root.AItems.Count);
        }
Beispiel #11
0
        public void ListRedo()
        {
            var cl   = new TstClient();
            var root = cl.GetRoot <Root>();

            var cnt = root.AItems.Count;

            root.AItems.Add(new A());

            cl.Undo(root.Uid);
            Assert.AreEqual(cnt, root.AItems.Count);

            cl.Redo(root.Uid);
            Assert.AreEqual(cnt + 1, root.AItems.Count);
        }
Beispiel #12
0
        public void Redo()
        {
            var cl    = new TstClient();
            var pr    = cl.GetRoot <Root>().ParentItems.First();
            var child = new Child {
                Value = 3.0
            };
            var cnt = pr.Children.Count;

            pr.Children.Add(child);
            cl.Undo(pr.Uid);
            Assert.AreEqual(cnt, pr.Children.Count);
            cl.Redo(pr.Uid);
            Assert.AreEqual(true, pr.Children.SingleOrDefault(_child => _child.Uid == child.Uid) != null);
        }