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); }
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); }
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); }
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)); }
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); }
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); }
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 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); }
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); }
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); }