예제 #1
0
        public void TestTypesAndFieldMemberAttributes()
        {
            string[] expected = new string[]
            {
                "namespace Test.Namespace",
                "{",
                "    public class TestClass",
                "    {",
                "        private int i;",
                "",
                "        public uint ui;",
                "",
                "        protected short s;",
                "",
                "        internal ushort us;",
                "",
                "        protected internal long l;",
                "",
                "        private protected ulong ul;",
                "",
                "        private static bool bo;",
                "",
                "        private const byte b = 123;",
                "",
                "        private sbyte sb;",
                "",
                "        private char c;",
                "",
                "        private new decimal dec;",
                "",
                "        private float f;",
                "",
                "        private double d = 0;",
                "",
                "        private object obj = new object();",
                "",
                "        private string str;",
                "",
                "        private int? nullableInt;",
                "",
                "        private System.Console console;",
                "",
                "        private System.Collections.Generic.IDictionary<int, System.Collections.Generic.IList<double>> dictionary;",
                "",
                "        private double[,] array;",
                "",
                "        private System.DateTime someDate;",
                "    }",
                "}"
            };

            ProviderTestUtils.DoCSharpTest(expected, ProviderTestUtils.TestTypesAndFieldMemberAttributesCompileUnit());
        }
예제 #2
0
        public void TestTypesAndFieldMemberAttributes()
        {
            string[] expected =
            {
                "Namespace Test.Namespace",
                "    Public Class TestClass",
                "        Private i As Integer",
                "",
                "        Public ui As UInteger",
                "",
                "        Protected s As Short",
                "",
                "        Friend us As UShort",
                "",
                "        Protected Friend l As Long",
                "",
                "        Private Protected ul As ULong",
                "",
                "        Private Shared bo As Boolean",
                "",
                "        Private Const b As Byte = 123",
                "",
                "        Private sb As SByte",
                "",
                "        Private c As Char",
                "",
                "        Private Shadows dec As Decimal",
                "",
                "        Private f As Single",
                "",
                "        Private d As Double = 0",
                "",
                "        Private obj As Object = New Object()",
                "",
                "        Private str As String",
                "",
                "        Private nullableInt As Integer?",
                "",
                "        Private console As System.Console",
                "",
                "        Private dictionary As System.Collections.Generic.IDictionary(Of Integer, System.Collections.Generic.IList(Of Double))",
                "",
                "        Private array As Double(,)",
                "",
                "        Private someDate As Date",
                "    End Class",
                "End Namespace"
            };

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