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)); }
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)); }
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)); }
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)); }