public void NoChange() { var source = new SimpleModelWithDictionary(); var patched = new SimpleModelWithDictionary(); var diff = DiffBuilder.Build(source, patched); Assert.Null(diff); }
public void NullToEmpty() { var source = new SimpleModelWithDictionary() { Dic = null }; var patched = new SimpleModelWithDictionary(); var diff = DiffBuilder.Build(source, patched); Assert.True(JObject.DeepEquals( JObject.Parse("{Dic:{}}"), diff)); }
public void KeyMissing() { var source = new SimpleModelWithDictionary() { Dic = new Dictionary <string, string>() { { "key1", "val1" } } }; var patched = new SimpleModelWithDictionary(); var diff = DiffBuilder.Build(source, patched); Assert.True(JObject.DeepEquals( JObject.Parse("{Dic:{\"key1\": null}}"), diff)); }