예제 #1
0
        public void MetaEnityAttributeTest()
        {
            var dbContext = AttributeTestDbContext.Create();
            var meta      = new MetaData();

            meta.LoadFromDbContext(dbContext);

            meta.EntityRoot.SubEntities.Should().HaveCount(1);

            var entity = meta.EntityRoot.SubEntities.First();

            entity.Name.Should().Be("Test");
            entity.Description.Should().Be("Test Description");
        }
예제 #2
0
        public void MetaEntityAttrAttributeTest()
        {
            var dbContext = AttributeTestDbContext.Create();
            var meta      = new MetaData();

            meta.LoadFromDbContext(dbContext);

            var entity = meta.EntityRoot.SubEntities.First();

            entity.Attributes.Should().HaveCount(10);

            var attr = entity.FindAttributeById("CustomerAttributeTest.Region");

            attr.IsVisible.Should().BeFalse();
            attr.ShowInLookup.Should().BeTrue();
            attr.IsEditable.Should().BeFalse();
            attr.Caption.Should().Be("Test");
        }