Beispiel #1
0
 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());
 }
Beispiel #2
0
        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());
        }
Beispiel #3
0
        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"));
        }
Beispiel #4
0
 public bool IsNew(Bean bean)
 {
     return(IsNew(bean.GetKind(), bean.Export()));
 }