public void MethodTestOneAttributeNoTypeParamsOneParamStringRep() { var methodSymbol = (IMethodSymbol)TestResource.GetTestMember("TestLibrary.PublicClass", "StaticVoid"); MethodApiView method = new MethodApiView(methodSymbol); string stringRep = method.ToString().Replace(Environment.NewLine, ""); Assert.Equal("[System.Diagnostics.ConditionalAttribute(\"DEBUG\")]public static void StaticVoid(string[] args) { }", stringRep); }
public void MethodTestMultipleAttributesMultipleTypeParamsNoParamsStringRep() { var methodSymbol = (IMethodSymbol)TestResource.GetTestMember("TestLibrary.PublicInterface`1", "AttributesTypeParamsMethod"); MethodApiView method = new MethodApiView(methodSymbol); string stringRep = method.ToString().Replace(Environment.NewLine, ""); Assert.Equal("[TestLibrary.CustomAttribute(\"Test\", Named = \"Param\")][TestLibrary.NewAttribute]int AttributesTypeParamsMethod<T, R>();", stringRep); }
public void MethodTestNoAttributesOneTypeParamMultipleParamsStringRep() { var methodSymbol = (IMethodSymbol)TestResource.GetTestMember("TestLibrary.PublicInterface`1", "TypeParamParamsMethod"); MethodApiView method = new MethodApiView(methodSymbol); Assert.Equal("int TypeParamParamsMethod<T>(T param, string str = \"hello\");", method.ToString().Replace(Environment.NewLine, "")); }