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 IndentLinesIndentsChildElementUsingTextEditorIndentationString() { document.Text = "<root>\r\n" + "<child>\r\n" + "</child>\r\n" + "</root>"; string expectedText = "<root>\r\n" + " <child>\r\n" + " </child>\r\n" + "</root>"; MockTextEditorOptions options = new MockTextEditorOptions(); options.IndentationString = " "; textEditor.Options = options; formattingStrategy.IndentLines(textEditor, 1, 4); Assert.AreEqual(expectedText, document.Text); }
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); }
public void CanSetAndGetTextEditorOptions() { MockTextEditorOptions options = new MockTextEditorOptions(); editor.Options = options; Assert.AreSame(options, editor.Options); }
public void Init() { options = new MockTextEditorOptions(); }