Example #1
0
        public void GetModelProperties_ModelHasIdAndNameProperty_NamePropertyIsNotMarkedAsPrimaryKey()
        {
            CreateViewTemplatePreprocessor();
            mvcHost.ViewDataType = typeof(ModelWithIdProperty);

            Details.ModelProperty modelProperty = GetModelProperty("Name");

            Assert.IsFalse(modelProperty.IsPrimaryKey);
        }
Example #2
0
        public void GetModelProperties_ModelHasPrefixedIdPropertyInLowerCase_PrefixedIdPropertyIsMarkedAsPrimaryKey()
        {
            CreateViewTemplatePreprocessor();
            mvcHost.ViewDataType = typeof(ModelWithPrefixedIdPropertyInLowerCase);

            Details.ModelProperty modelProperty = GetModelProperty("modelwithprefixedidpropertyinlowercaseid");

            Assert.IsTrue(modelProperty.IsPrimaryKey);
        }
Example #3
0
        public void GetModelProperties_ModelHasOnePropertyCalledName_ReturnsModelPropertyCalledName()
        {
            CreateViewTemplatePreprocessor();
            mvcHost.ViewDataType = typeof(ModelWithOneProperty);

            Details.ModelProperty modelProperty = GetFirstModelProperty();

            Assert.AreEqual("Name", modelProperty.Name);
        }