public void TestMethod() { // Arrange var engine = new FormattingEngine(); var sut = new ParamBuilderFormatter(engine); // Act string result = sut.Execute(sample); // Assert Assert.AreEqual(expected, result); }
// Experimental (not working!) //private static int GetStartIndent( TextDocument textDocument ) //{ // var text = textDocument.Selection.Text; // int index = 0; // while ( ( text[ index ] == ' ' ) && ( text[ index ] != '\n' ) ) // index++; // return index + textDocument.Selection.AnchorColumn; //} public SqlFormatter(AddIn addIn) : base(addIn) { _engine = new FormattingEngine(); _engine.IndentStep = 0; // experimental: GetStartIndent( textDocument ) / engine.TabSize; KeyName = "LaanSqlFormat"; DisplayName = "Format SQL"; DescriptivePhrase = "Formatting SQL"; ButtonText = "Format S&QL"; ToolTip = "Formats the current file"; ImageIndex = 59; KeyboardBinding = "Text Editor::Ctrl+`"; }