Ejemplo n.º 1
0
 public void CanAddObjectIfPropertyNotExists()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var s = SimulationFactory.When.I.Post().ToImdb("/Pet").Simulation;
     manager.AddToImdb(s, "/Pet", "/Pet", @"{ }", null);
     Assert.IsTrue(manager.CanAddObject(s, "/Pet", "TheProperty", @"{ ""TheProperty"" : ""TheValue"" }", null));
 }
Ejemplo n.º 2
0
 public void CanAddObjectIfValidJsonAndPropertyIsNull()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var s = SimulationFactory.When.I.Post().ToImdb("/Pet").Simulation;
     Assert.IsTrue(manager.CanAddObject(s, "/Pet", "TheProperty", "{ }", null));
 }
Ejemplo n.º 3
0
 public void CanNotAddObjectIfPropertyIsImplicitlyAlreadyNull()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var s = SimulationFactory.When.I.Post().ToImdb("/Pet").Simulation;
     manager.AddToImdb(s, "/Pet", "/Pet", @"{ }", null);
     Assert.IsFalse(manager.CanAddObject(s, "/Pet", "TheProperty", "{ }", null));
 }
Ejemplo n.º 4
0
 public void CanAddObjectWithPropertyNoneExistent()
 {
     Moksy.Storage.SimulationManager manager = new Storage.SimulationManager();
     var s = SimulationFactory.When.I.Post().ToImdb("/Pet").Simulation;
     Assert.IsFalse(manager.CanAddObject(s, "/Pet", "TheProperty", "thisisnotjson", null));
 }