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()); }
public void TestUsingInvalidInput() { Assert.AreEqual(string.Empty, CustomApexCodeGenerator.FormatApex(null)); Assert.AreEqual(string.Empty, CustomApexCodeGenerator.FormatApex(" ")); Assert.AreEqual(string.Empty, CustomApexCodeGenerator.GenerateApex(null)); }
private void Check(string source, string expected, Settings settings = null) => CompareLineByLine(CustomApexCodeGenerator.FormatApex(source, settings), expected);