コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }
コード例 #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));
 }