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)); }
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)); }
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 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)); }
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)); }
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 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)); }
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)); }
public void GetRootIsUndoEnabledByDefault() { var cl = new TstClient(); var a = cl.GetRoot <RootVM>().AItems.First(); Assert.AreEqual(false, cl.GetIsUndoEnabled(a)); }
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)); }
public void GetRootIsUndoEnabledByDefault() { var cl = new TstClient(); var a = cl.GetRoot<RootVM>().AItems.First(); Assert.AreEqual(false, cl.GetIsUndoEnabled(a)); }
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)); }