Beispiel #1
0
        public void ApexTypesGetConvertedToCSharpTypes()
        {
            var apexVoid = new TypeSyntax(ApexKeywords.Void);

            Assert.AreEqual("void", apexVoid.ToCSharp());

            var apexContact = new TypeSyntax("MyApp", "Dto", "Contact");

            Assert.AreEqual("MyApp.Dto.Contact", apexContact.ToCSharp());

            var apexList = new TypeSyntax("List")
            {
                TypeParameters = new List <TypeSyntax>
                {
                    new TypeSyntax("Custom", "Class")
                }
            };

            Assert.AreEqual("List<Custom.Class>", apexList.ToCSharp());

            var apexArray = new TypeSyntax("String")
            {
                IsArray = true
            };

            Assert.AreEqual("string[]", apexArray.ToCSharp());
        }