示例#1
0
        public static string GenerateApex(BaseSyntax ast, Settings settings = null)
        {
            if (ast == null)
            {
                return(string.Empty);
            }

            settings = settings ?? new Settings();
            var generator = new CustomApexCodeGenerator
            {
                Settings   = settings,
                IndentSize = settings.TabIndentSize
            };

            ast.Accept(generator);
            return(generator.Code.ToString());
        }
示例#2
0
 public void TestUsingInvalidInput()
 {
     Assert.AreEqual(string.Empty, CustomApexCodeGenerator.FormatApex(null));
     Assert.AreEqual(string.Empty, CustomApexCodeGenerator.FormatApex("  "));
     Assert.AreEqual(string.Empty, CustomApexCodeGenerator.GenerateApex(null));
 }
示例#3
0
 private void Check(string source, string expected, Settings settings = null) =>
 CompareLineByLine(CustomApexCodeGenerator.FormatApex(source, settings), expected);