diff options
author | Mike Krüger <mkrueger@xamarin.com> | 2016-05-11 10:10:57 +0300 |
---|---|---|
committer | Mike Krüger <mkrueger@xamarin.com> | 2016-05-17 17:12:22 +0300 |
commit | e79dc651f31f1d62bf10e99d6820b3c0d8732a47 (patch) | |
tree | b7983a09afc2552426075653209e2cab15e5c3d0 /main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/FoldingTests.cs | |
parent | a2cf84565b03f95cc1993d7218de1e913e59b098 (diff) |
[SourceEditor] Unified fold segment subsystems.
Diffstat (limited to 'main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/FoldingTests.cs')
-rw-r--r-- | main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/FoldingTests.cs | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/FoldingTests.cs b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/FoldingTests.cs index cbbe2e0bea..f2ab1d7c74 100644 --- a/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/FoldingTests.cs +++ b/main/src/core/MonoDevelop.TextEditor.Tests/Mono.TextEditor.Tests/FoldingTests.cs @@ -31,6 +31,7 @@ using System.Collections.Generic; using System.Linq; using NUnit.Framework; using Mono.TextEditor.Tests.Actions; +using MonoDevelop.Ide.Editor; namespace Mono.TextEditor.Tests { @@ -78,8 +79,8 @@ namespace Mono.TextEditor.Tests char ch = doc.GetCharAt (i); if ((ch == '+' || ch == '-') && doc.GetCharAt(i + 1) == '[') { - FoldSegment segment = new FoldSegment (doc, "...", i, 0, FoldingType.None); - segment.IsFolded = ch == '+'; + FoldSegment segment = new FoldSegment (doc, "...", i, 0, FoldingType.Unknown); + segment.IsCollapsed = ch == '+'; foldSegments.Push (segment); } else if (ch == ']' && foldSegments.Count > 0) { FoldSegment segment = foldSegments.Pop (); @@ -293,9 +294,9 @@ namespace Mono.TextEditor.Tests 10"); var segments = GetFoldSegments (data.Document); data.Document.UpdateFoldSegments (segments); - Assert.AreEqual (true, data.Document.FoldSegments.FirstOrDefault ().IsFolded); + Assert.AreEqual (true, data.Document.FoldSegments.FirstOrDefault ().IsCollapsed); segments = GetFoldSegments (data.Document); - segments[0].IsFolded = false; + segments[0].IsCollapsed = false; data.Document.UpdateFoldSegments (segments); Assert.AreEqual (5, data.LogicalToVisualLine (8)); } @@ -464,8 +465,8 @@ $1234567890"); var segments = GetFoldSegments (data.Document); data.Document.UpdateFoldSegments (segments); Assert.AreEqual (15, data.LogicalToVisualLine (15)); - data.Document.GetStartFoldings (6).First ().IsFolded = true; - data.Document.GetStartFoldings (4).First ().IsFolded = true; + data.Document.GetStartFoldings (6).First ().IsCollapsed = true; + data.Document.GetStartFoldings (4).First ().IsCollapsed = true; Assert.AreEqual (11, data.LogicalToVisualLine (15)); } @@ -492,8 +493,8 @@ $1234567890"); var segments = GetFoldSegments (data.Document); data.Document.UpdateFoldSegments (segments); Assert.AreEqual (11, data.LogicalToVisualLine (15)); - data.Document.GetStartFoldings (6).First ().IsFolded = false; - data.Document.GetStartFoldings (4).First ().IsFolded = false; + data.Document.GetStartFoldings (6).First ().IsCollapsed = false; + data.Document.GetStartFoldings (4).First ().IsCollapsed = false; Assert.AreEqual (15, data.LogicalToVisualLine (15)); } @@ -515,7 +516,7 @@ AAAAAAAA Assert.AreEqual (new DocumentLocation (2, 9), data.Caret.Location); CaretMoveActions.Down (data); CaretMoveActions.Down (data); - Assert.AreEqual (true, data.Document.FoldSegments.First ().IsFolded); + Assert.AreEqual (true, data.Document.FoldSegments.First ().IsCollapsed); Assert.AreEqual (new DocumentLocation (8, 9), data.Caret.Location); } @@ -536,7 +537,7 @@ AAAAAAAA$ Assert.AreEqual (new DocumentLocation (8, 9), data.Caret.Location); CaretMoveActions.Up (data); - Assert.AreEqual (true, data.Document.FoldSegments.First ().IsFolded); + Assert.AreEqual (true, data.Document.FoldSegments.First ().IsCollapsed); Assert.AreEqual (new DocumentLocation (3, 9), data.Caret.Location); } @@ -557,7 +558,7 @@ AAAAAAAA$ Assert.AreEqual (new DocumentLocation (8, 9), data.Caret.Location); CaretMoveActions.Up (data); - Assert.AreEqual (true, data.Document.FoldSegments.First ().IsFolded); + Assert.AreEqual (true, data.Document.FoldSegments.First ().IsCollapsed); Assert.AreEqual (new DocumentLocation (3, 3), data.Caret.Location); } |