public void SerializeAnObjectMustContainsTheirProperties() { var @object = new Screw.Framework.Kernel.Json.Object ( new Dictionary<string,Screw.Framework.Kernel.Json.Value> { { "a", new Screw.Framework.Kernel.Json.Null () } } ); Assert.AreEqual ("{\"a\":null}", Domain.Json.Serialize (@object)); }
public void AllPropertiesOnObjectMustMatch() { var properties = new Dictionary<string, Screw.Framework.Kernel.Json.Value> (); var value1 = new Screw.Framework.Kernel.Json.Value (); var value2 = new Screw.Framework.Kernel.Json.Value (); var value3 = new Screw.Framework.Kernel.Json.Value (); properties.Add ("a", value1); properties.Add ("b", value2); properties.Add ("c", value3); var @object = new Screw.Framework.Kernel.Json.Object (properties); Assert.AreEqual (3, @object.Properties.Count); Assert.IsTrue (@object.Properties.ContainsKey ("a")); Assert.IsTrue (@object.Properties.ContainsKey ("b")); Assert.IsTrue (@object.Properties.ContainsKey ("c")); Assert.AreSame (value1, @object.Properties ["a"]); Assert.AreSame (value2, @object.Properties ["b"]); Assert.AreSame (value3, @object.Properties ["c"]); }