Esempio n. 1
0
        public void TestDirective()
        {
            string[] expected =
            {
                "#Region \"Compile unit region\"",
                "Option Strict Off",
                "Option Explicit On",
                "Option Infer On",
                "",
                "Namespace Test.Namespace",
                "    #Region \"Class region\"",
                "    Public Class TestClass",
                "        #Region \"Fields region\"",
                "        Private a As Integer",
                "",
                "        Private b As Integer",
                "        #End Region",
                "",
                "        Public Sub Method()",
                "            #Region \"region a\"",
                "            #Region \"region b\"",
                "            a = b",
                "            Return a",
                "            #End Region",
                "            #End Region",
                "        End Sub",
                "    End Class",
                "    #End Region",
                "End Namespace",
                "#End Region"
            };

            ProviderTestUtils.DoVisualBasicTest(expected, ProviderTestUtils.TestDirectiveCompileUnit(), addOptions: false);
        }
Esempio n. 2
0
 public void TestDirective()
 {
     string[] expected =
     {
         "#region Compile unit region",
         "namespace Test.Namespace",
         "{",
         "    #region Class region",
         "    public class TestClass",
         "    {",
         "        #region Fields region",
         "        private int a;",
         "",
         "        private int b;",
         "        #endregion",
         "",
         "        public void Method()",
         "        {",
         "            #region region a",
         "            #region region b",
         "            a = b;",
         "            return a;",
         "            #endregion",
         "            #endregion",
         "        }",
         "    }",
         "    #endregion",
         "}",
         "#endregion"
     };
     ProviderTestUtils.DoCSharpTest(expected, ProviderTestUtils.TestDirectiveCompileUnit());
 }