public void CodeGen_Attribute_DisplayAttribute_Resourced_DifferentNamespace() { MockSharedCodeService sts = TestHelper.CreateCommonMockSharedCodeService(); string generatedCode = TestHelper.GenerateCodeAssertSuccess("C#", new Type[] { typeof(Mock_CG_DisplayAttr_Entity_Shared_ResourceType_DifferentNamespace) }, null, sts); TestHelper.AssertGeneratedCodeContains(generatedCode, @"[Display(Description=""Resource4"", Name=""Resource2"", Prompt=""Resource3"", ResourceType=typeof(Mock_CG_DisplayAttr_Shared_ResourceType_DifferentNamespace), ShortName=""Resource1"")]"); TestHelper.AssertGeneratedCodeContains(generatedCode, @"[Display(Description=""Literal4"", Name=""Literal2"", Prompt=""Literal3"", ShortName=""Literal1"")]"); }
public void CodeGen_Attribute_StringLength_Valid_ResourceType_And_Name() { MockSharedCodeService sts = TestHelper.CreateCommonMockSharedCodeService(); string generatedCode = TestHelper.GenerateCodeAssertSuccess("C#", new[] { typeof(Mock_CG_Attr_Entity_StringLength_Valid) }, null, sts); TestHelper.AssertGeneratedCodeContains(generatedCode, "[StringLength(10, ErrorMessageResourceName=\"TheResource\", ErrorMessageResourceType=typeof(Mock_CG_Attr_Entity_StringLength_ResourceType))] " + "public string StringProperty"); }