public void GetModelProperties_ModelHasIdAndNameProperty_NamePropertyIsNotMarkedAsPrimaryKey() { CreateViewTemplatePreprocessor(); mvcHost.ViewDataType = typeof(ModelWithIdProperty); Details.ModelProperty modelProperty = GetModelProperty("Name"); Assert.IsFalse(modelProperty.IsPrimaryKey); }
public void GetModelProperties_ModelHasPrefixedIdPropertyInLowerCase_PrefixedIdPropertyIsMarkedAsPrimaryKey() { CreateViewTemplatePreprocessor(); mvcHost.ViewDataType = typeof(ModelWithPrefixedIdPropertyInLowerCase); Details.ModelProperty modelProperty = GetModelProperty("modelwithprefixedidpropertyinlowercaseid"); Assert.IsTrue(modelProperty.IsPrimaryKey); }
public void GetModelProperties_ModelHasOnePropertyCalledName_ReturnsModelPropertyCalledName() { CreateViewTemplatePreprocessor(); mvcHost.ViewDataType = typeof(ModelWithOneProperty); Details.ModelProperty modelProperty = GetFirstModelProperty(); Assert.AreEqual("Name", modelProperty.Name); }