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]); }
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()); }
public void GetKeysNoEntriesPathNotAdded() { Moksy.Storage.SimulationManager manager = new Storage.SimulationManager(); var result = manager.GetKeysFor("/NoneExistent", "/NoneExistent", "Kind", null); Assert.AreEqual(0, result.Count()); }
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]); }
public void GetKeysNoEntriesIsNull() { Moksy.Storage.SimulationManager manager = new Storage.SimulationManager(); var result = manager.GetKeysFor(null, null, null, null); Assert.AreEqual(0, result.Count()); }