public void Type_PropertyTypeIsSystemString_TypesParentIsProperty() { helper.CreatePublicProperty("MyProperty"); helper.SetPropertyReturnType("System.String"); CreateCodeProperty2(); global::EnvDTE.CodeTypeRef typeRef = property.Type; global::EnvDTE.CodeElement parent = typeRef.Parent; Assert.AreEqual(property, parent); }
public void Type_PropertyTypeIsSystemString_ReturnsSystemString() { helper.CreatePublicProperty("MyProperty"); helper.SetPropertyReturnType("System.String"); CreateCodeProperty2(); global::EnvDTE.CodeTypeRef typeRef = property.Type; string fullName = typeRef.AsFullName; Assert.AreEqual("System.String", fullName); }
public void Type_PropertyTypeIsSystemString_TypeRefTypeInfoLocationIsExternal() { CreateCodeProperty2( "using System;\r\n" + "class MyClass {\r\n" + " public string MyProperty { get; set; }\r\n" + "}"); global::EnvDTE.CodeTypeRef typeRef = property.Type; global::EnvDTE.vsCMInfoLocation location = typeRef.CodeType.InfoLocation; Assert.AreEqual(global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationExternal, location); }
public void Type_PropertyTypeIsSystemString_TypesParentIsProperty() { CreateCodeProperty2( "using System;\r\n" + "class MyClass {\r\n" + " public string MyProperty { get; set; }\r\n" + "}"); global::EnvDTE.CodeTypeRef typeRef = property.Type; global::EnvDTE.CodeElement parent = typeRef.Parent; Assert.AreEqual(property, parent); }
public void Type_PropertyTypeIsSystemString_ReturnsSystemString() { CreateCodeProperty2( "using System;\r\n" + "class MyClass {\r\n" + " public string MyProperty { get; set; }\r\n" + "}"); global::EnvDTE.CodeTypeRef typeRef = property.Type; string fullName = typeRef.AsFullName; Assert.AreEqual("System.String", fullName); }
public void Type_PropertyTypeExistsInProject_TypeRefTypeInfoLocationIsProject() { CreateCodeProperty2( "using System;\r\n" + "public class MyClass {\r\n" + " public MyType MyProperty { get; set; }\r\n" + "}\r\n" + "public class MyType {}"); global::EnvDTE.CodeTypeRef typeRef = property.Type; global::EnvDTE.vsCMInfoLocation location = typeRef.CodeType.InfoLocation; Assert.AreEqual(global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationProject, location); }
public void Type_PropertyTypeExistsInProject_TypeRefTypeInfoLocationIsProject() { helper.CreatePublicProperty("MyProperty"); helper.SetPropertyReturnType("MyType"); helper.CreateProjectForProjectContent(); var classHelper = new ClassHelper(); classHelper.CreateClass("MyType"); classHelper.SetProjectForProjectContent(helper.Project); helper.ReturnTypeHelper.AddUnderlyingClass(classHelper.Class); CreateCodeProperty2(); global::EnvDTE.CodeTypeRef typeRef = property.Type; global::EnvDTE.vsCMInfoLocation location = typeRef.CodeType.InfoLocation; Assert.AreEqual(global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationProject, location); }
public void Type_PropertyTypeIsSystemString_TypeRefTypeInfoLocationIsExternal() { helper.CreatePublicProperty("MyProperty"); helper.SetPropertyReturnType("System.String"); helper.CreateProjectForProjectContent(); var classHelper = new ClassHelper(); classHelper.CreateClass("System.String"); classHelper.SetProjectForProjectContent(null); helper.ReturnTypeHelper.AddUnderlyingClass(classHelper.Class); CreateCodeProperty2(); global::EnvDTE.CodeTypeRef typeRef = property.Type; global::EnvDTE.vsCMInfoLocation location = typeRef.CodeType.InfoLocation; Assert.AreEqual(global::EnvDTE.vsCMInfoLocation.vsCMInfoLocationExternal, location); }