public void Init() { formattingStrategy = new XmlFormattingStrategy(); options = new MockTextEditorOptions(); textEditor = new MockTextEditor(); textEditor.Options = options; textDocument = new TextDocument(); document = textDocument; textEditor.SetDocument(document); }
public void Init() { formattingStrategy = new XmlFormattingStrategy(); options = new MockTextEditorOptions(); textEditor = new MockTextEditor(); textEditor.Options = options; textDocument = new TextDocument(); document = new AvalonEditDocumentAdapter(textDocument, null); textEditor.SetDocument(document); }
public void Init() { formattingStrategy = new XmlFormattingStrategy(); options = new MockTextEditorOptions(); textEditor = new MockTextEditor(); textEditor.Options = options; textDocument = new TextDocument(); document = textDocument; textEditor.SetDocument(document); document.Text = "<root>\r\n" + "\t<child>\r\n" + "</root>\r\n"; // Just typed the '>' character of the <child> element textEditor.Caret.Offset = 16; formattingStrategy.FormatLine(textEditor, '>'); }
public void Init() { formattingStrategy = new XmlFormattingStrategy(); options = new MockTextEditorOptions(); textEditor = new MockTextEditor(); textEditor.Options = options; textDocument = new TextDocument(); document = textDocument; textEditor.SetDocument(document); document.Text = "<root>\r\n" + "\t<child>\r\n" + "</child>\r\n" + "</root>\r\n"; docLine = MockRepository.GenerateStub<IDocumentLine>(); docLine.Stub(l => l.LineNumber).Return(3); formattingStrategy.IndentLine(textEditor, docLine); }
public void Init() { formattingStrategy = new XmlFormattingStrategy(); options = new MockTextEditorOptions(); textEditor = new MockTextEditor(); textEditor.Options = options; textDocument = new TextDocument(); document = new AvalonEditDocumentAdapter(textDocument, null); textEditor.SetDocument(document); document.Text = "<root>\r\n" + "\t<child>\r\n" + "</child>\r\n" + "</root>\r\n"; docLine = new MockDocumentLine(); docLine.LineNumber = 3; formattingStrategy.IndentLine(textEditor, docLine); }
public void Init() { formattingStrategy = new XmlFormattingStrategy(); options = new MockTextEditorOptions(); textEditor = new MockTextEditor(); textEditor.Options = options; textDocument = new TextDocument(); document = textDocument; textEditor.SetDocument(document); textDocument.Text = "<root>\r\n" + "\t<child></child>\r\n" + "</root>"; int selectionStart = 9; int selectionLength = 15; textEditor.Select(selectionStart, selectionLength); formattingStrategy.SurroundSelectionWithComment(textEditor); }