예제 #1
0
 public void GetTwoKeysForObject()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var s = SimulationFactory.When.I.Post().ToImdb("/Pet").Simulation;
     s.Condition.SimulationConditionContent.IndexProperty = "Kind";
     manager.AddToImdb(s, "/Pet", "/Pet", @"{ ""Kind"" : ""Dog"" }", null);
     manager.AddToImdb(s, "/Pet", "/Pet", @"{ ""Kind"" : ""Cat"" }", null);
     var result = manager.GetKeysFor("/Pet", "/Pet", "Kind", null);
     Assert.AreEqual(2, result.Count());
     Assert.AreEqual("Dog", result.ToArray()[0]);
     Assert.AreEqual("Cat", result.ToArray()[1]);
 }
예제 #2
0
 public void GetsNoKeysForNullObject()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var s = SimulationFactory.When.I.Post().ToImdb("/Pet").Simulation;
     manager.AddToImdb(s, "/Pet", "/Pet", "{ }", null);
     var result = manager.GetKeysFor("/Pet", "/Pet", "Kind", null);
     Assert.AreEqual(0, result.Count());
 }
예제 #3
0
 public void GetKeysNoEntriesPathNotAdded()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var result = manager.GetKeysFor("/NoneExistent", "/NoneExistent", "Kind", null);
     Assert.AreEqual(0, result.Count());
 }
예제 #4
0
 public void GetOneKeysForObject()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var s = SimulationFactory.When.I.Post().ToImdb("/Pet").Simulation;
     manager.AddToImdb(s, "/Pet", "/Pet", @"{ ""Kind"" : ""Dog"" }", null);
     var result = manager.GetKeysFor("/Pet", "/Pet", "Kind", null);
     Assert.AreEqual(1, result.Count());
     Assert.AreEqual("Dog", result.ToArray()[0]);
 }
예제 #5
0
 public void GetKeysNoEntriesIsNull()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var result = manager.GetKeysFor(null, null, null, null);
     Assert.AreEqual(0, result.Count());
 }