Example #1
0
        public void EntityCollectionSerialize()
        {
            DynamicEntityCollection sourceEntity = MockData.CreateRelationDynamicEntityCollection();
            string json = JSONSerializerExecute.Serialize(sourceEntity);

            sourceEntity.ForEach(e => e.Fields.ForEach(f =>
            {
                Assert.IsTrue(json.Contains(f.Name), string.Format("不能再序列化的JSON中找到属性名{0}", f.Name));
            }));
        }
        public void EntitiyCollectionToStringTest()
        {
            DynamicEntityCollection TestData = new DynamicEntityCollection();

            //创建测试数据
            TestData.CopyFrom(MockData.CreateRelationDynamicEntityCollection());

            var result = TestData.ToString();

            Assert.IsTrue(!string.IsNullOrEmpty(result));
        }