public void Export() { var bean = new Bean(); bean["id"] = 123; bean.Put("a", 1).Put("b", "abc"); AssertExtensions.Equivalent(bean.Export(), new Dictionary<string, object> { { "id", 123 }, { "a", 1 }, { "b", "abc" } }); Assert.NotSame(bean.Export(), bean.Export()); }
public void Export() { var bean = new Bean(); bean["id"] = 123; bean.Put("a", 1).Put("b", "abc"); AssertExtensions.Equivalent(bean.Export(), new Dictionary <string, object> { { "id", 123 }, { "a", 1 }, { "b", "abc" } }); Assert.NotSame(bean.Export(), bean.Export()); }
public void ExportWithIgnorelist() { var bean = new Bean { ["id"] = 123 }; bean.Put("a", 1).Put("b", "abc"); AssertExtensions.Equivalent(bean.Export("id"), new Dictionary <string, object> { { "a", 1 }, { "b", "abc" } }); AssertExtensions.Equivalent(bean.Export("id,b"), new Dictionary <string, object> { { "a", 1 } }); AssertExtensions.Equivalent(bean.Export("id,a,b"), new Dictionary <string, object>()); Assert.NotSame(bean.Export("id"), bean.Export("id")); Assert.NotSame(bean.Export("id,b"), bean.Export("id,b")); Assert.NotSame(bean.Export("id,a,b"), bean.Export("id,a,b")); }
public bool IsNew(Bean bean) { return(IsNew(bean.GetKind(), bean.Export())); }