public void Type_MethodReturnsString_TypeRefParentIsCodeFunction() { CreatePublicFunction("MyClass.MyFunction"); AddReturnTypeToMethod("System.String"); global::EnvDTE.CodeTypeRef2 typeRef = codeFunction.Type; Assert.AreEqual(codeFunction, typeRef.Parent); }
public void Type_MethodReturnsString_TypeRefUsesProjectContentFromMethod() { CreatePublicFunction("MyClass.MyFunction"); AddReturnTypeToMethod("System.String"); global::EnvDTE.CodeTypeRef2 typeRef = codeFunction.Type; Assert.AreEqual("string", typeRef.AsString); }
public void Type_MethodReturnsString_TypeRefHasSystemStringAsFullName() { CreatePublicFunction("MyClass.MyFunction"); AddReturnTypeToMethod("System.String"); global::EnvDTE.CodeTypeRef2 typeRef = codeFunction.Type; Assert.AreEqual("System.String", typeRef.AsFullName); }
public void Type_MethodReturnsString_TypeRefParentIsCodeFunction() { CreateFunction( "using System;\r\n" + "public class MyClass {\r\n" + " public string MyMethod() {}\r\n" + "}"); global::EnvDTE.CodeTypeRef2 typeRef = codeFunction.Type; Assert.AreEqual(codeFunction, typeRef.Parent); }
public void Type_MethodReturnsString_TypeRefUsesProjectContentFromMethod() { CreateFunction( "using System;\r\n" + "public class MyClass {\r\n" + " public string MyMethod() {}\r\n" + "}"); global::EnvDTE.CodeTypeRef2 typeRef = codeFunction.Type; global::EnvDTE.TextPoint textPoint = typeRef.CodeType.GetStartPoint(); Assert.IsNotNull(textPoint); }
public void Type_MethodReturnsString_TypeRefHasSystemStringAsFullName() { CreateFunction( "using System;\r\n" + "public class MyClass {\r\n" + " public string MyMethod() {}\r\n" + "}"); global::EnvDTE.CodeTypeRef2 typeRef = codeFunction.Type; Assert.AreEqual("System.String", typeRef.AsFullName); Assert.AreEqual("string", typeRef.AsString); }