5
// Mike Krüger <mkrueger@novell.com>
7
// Copyright (c) 2010 Novell, Inc (http://www.novell.com)
9
// Permission is hereby granted, free of charge, to any person obtaining a copy
10
// of this software and associated documentation files (the "Software"), to deal
11
// in the Software without restriction, including without limitation the rights
12
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13
// copies of the Software, and to permit persons to whom the Software is
14
// furnished to do so, subject to the following conditions:
16
// The above copyright notice and this permission notice shall be included in
17
// all copies or substantial portions of the Software.
19
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
using NUnit.Framework;
31
namespace Mono.TextEditor.Tests
35
public class EditActionsTest
38
/// Bug 615191 - When using multiline selection to indent/outdent, the indenter selects too much
41
public void TestBug615196_IndentCase ()
43
TextEditorData data = new Mono.TextEditor.TextEditorData ();
44
data.Document.Text = "\n\n\n\n\n";
45
data.Caret.Offset = data.Document.GetLine (2).Offset; // 2nd.Line
46
data.MainSelection = new Selection (2, 1, 4, 1);
47
MiscActions.InsertTab (data);
48
MiscActions.InsertTab (data);
50
Assert.AreEqual ("\n\t\t\n\t\t\n\n\n", data.Document.Text);
54
public void TestBug615196_UnIndentCase ()
56
TextEditorData data = new Mono.TextEditor.TextEditorData ();
57
data.Document.Text = "\n\t\t\n\t\t\n\t\t\n\n";
58
data.Caret.Offset = data.Document.GetLine (2).Offset; // 2nd.Line
59
data.MainSelection = new Selection (2, 1, 4, 1);
60
MiscActions.RemoveTab (data);
61
MiscActions.RemoveTab (data);
63
Assert.AreEqual ("\n\n\n\t\t\n\n", data.Document.Text);