예제 #1
0
 public void TestDictionary()
 {
     var a = new PersistentDictionary<string, int>();
     a.Add("one", 1);
     a.Store();
     a.Add("two", 2);
     a.Undo();
     Assert.True(a.Count == 1);
     Assert.True(a["one"] == 1);
     a.Redo();
     Assert.True(a.Count == 2);
     Assert.True(a["one"] == 1);
     Assert.True(a["two"] == 2);
 }
예제 #2
0
 public void TestPersistentStructureDictionary()
 {
     var a = new PersistentDictionary<string, Persistent<int>>();
     a.Add("one", new Persistent<int>(1));
     a.Store();
     a["one"].Value = 2;
     a.Undo();
     Assert.True(a["one"].Value == 1);
     a.Redo();
     Assert.True(a["one"].Value == 2);
 }