Beispiel #1
0
        public void EntityModelTest()
        {
            EntityModel model = new EntityModel("col1", "col2");

            model.AddColumn("col3", "col3");
            model.AddColumn("col4", typeof(int));

            var testEntity = new Entity();

            testEntity.SetValue("col5", "test");

            var clonedEntity = testEntity.Clone();

            clonedEntity.AddDefaultInfo(model);
            Assert.IsTrue(clonedEntity.Columns.Length == 5);

            clonedEntity = testEntity.Clone();
            clonedEntity.ToStandradEntity(model);
            Assert.IsTrue(clonedEntity.Columns.Length == 4);
            Assert.IsTrue(!clonedEntity.Values.ContainsKey("col5"));
        }