Ejemplo n.º 1
0
        public void TestMethodSignature()
        {
            string[] expected = new string[]
            {
                "namespace Test.Namespace",
                "{",
                "    public class TestClass",
                "    {",
                "        static TestClass()",
                "        {",
                "        }",
                "",
                "        public TestClass()",
                "            : this(0)",
                "        {",
                "        }",
                "",
                "        private TestClass(int i)",
                "        {",
                "        }",
                "",
                "        private protected TestClass(int a, double b)",
                "            : base(a, b)",
                "        {",
                "        }",
                "",
                "        public static int Main(string[] args)",
                "        {",
                "        }",
                "",
                "        protected abstract void Method();",
                "",
                "        public virtual void Method()",
                "        {",
                "        }",
                "",
                "        public override void Method()",
                "        {",
                "        }",
                "",
                "        public void Method(int a, int b)",
                "        {",
                "        }",
                "",
                "        public static void Method()",
                "        {",
                "        }",
                "    }",
                "}"
            };

            ProviderTestUtils.DoCSharpTest(expected, ProviderTestUtils.TestMethodSignatureCompileUnit());
        }
Ejemplo n.º 2
0
        public void TestMethodSignature()
        {
            string[] expected =
            {
                "Namespace Test.Namespace",
                "    Public Class TestClass",
                "        Shared Sub New()",
                "        End Sub",
                "",
                "        Public Sub New()",
                "            Me.New(0)",
                "        End Sub",
                "",
                "        Private Sub New(ByVal i As Integer)",
                "        End Sub",
                "",
                "        Private Protected Sub New(ByVal a As Integer, ByVal b As Double)",
                "            MyBase.New(a, b)",
                "        End Sub",
                "",
                "        Public Shared Function Main(ByVal cmdArgs() As String) As Integer",
                "        End Function",
                "",
                "        Protected MustOverride Sub Method()",
                "",
                "        Public Overridable Sub Method()",
                "        End Sub",
                "",
                "        Public Overrides Sub Method()",
                "        End Sub",
                "",
                "        Public Sub Method(ByVal a As Integer, ByVal b As Integer)",
                "        End Sub",
                "",
                "        Public Shared Sub Method()",
                "        End Sub",
                "    End Class",
                "End Namespace"
            };

            ProviderTestUtils.DoVisualBasicTest(expected, ProviderTestUtils.TestMethodSignatureCompileUnit());
        }