示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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, ""));
        }