1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
4
using CSharpBinding.FormattingStrategy;
8
namespace CSharpBinding.Tests
11
public class CSharpFormattingTests
14
public void EnterInsideString()
16
const string start = "class X {\n" +
17
"\tstring text = \"a";
18
const string insertedMiddle = "\" +\n\t\"";
19
const string end = "b\";\n" +
21
MockTextEditor textEditor = new MockTextEditor();
22
textEditor.Document.Text = start + end;
23
textEditor.Select(start.Length, 0);
24
CSharpFormattingStrategy formattingStrategy = new CSharpFormattingStrategy();
25
textEditor.TextEditor.TextArea.PerformTextInput("\n");
26
formattingStrategy.FormatLine(textEditor, '\n');
27
Assert.AreEqual(start + insertedMiddle + end, textEditor.Document.Text);
28
Assert.AreEqual(start.Length + insertedMiddle.Length, textEditor.SelectionStart);
29
Assert.AreEqual(0, textEditor.SelectionLength);