~ubuntu-branches/ubuntu/saucy/monodevelop/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/UnitTests/Mono.TextEditor.Tests/HeightTreeTests.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2012-06-22 20:35:35 UTC
  • mfrom: (10.3.2)
  • Revision ID: package-import@ubuntu.com-20120622203535-zrozwvcf6kfk6l6i
Tags: 3.0.3.2+dfsg-1
* [3fd89ae] Imported Upstream version 3.0.3.2+dfsg
* [379a680] Remove old patches we haven't used for ages from git.
* [d71161d] Remove correct_paths_in_monodevelop-core-addins.pc.patch.
  Upstream claim to have fixed this by moving assembly install locations.
* [15dbfb9] Fix install location for MonoDevelop.Gettext.dll.config.
* [26eb434] Fix install location for MonoDevelop.SourceEditor2.dll.config.
* [4169974] Upstream commit 53282c9 which finally reconciles the 
  MonoDevelop.Gettext.dll install location with the 
  monodevelop-core-addins.pc location.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
namespace Mono.TextEditor.Tests
31
31
{
32
32
        [TestFixture()]
33
 
        public class HeightTreeTests
 
33
        public class HeightTreeTests 
34
34
        {
35
35
                [Test()]
36
36
                public void TestSimpleLineNumberToY ()
240
240
                                Assert.AreEqual (i, heightTree.YToLineNumber ((i - 1) * editor.LineHeight));
241
241
                        }
242
242
                }
243
 
                
244
 
                
 
243
 
 
244
                /// <summary>
 
245
                /// Bug 4839 - Hitting enter on last line of document makes editor scroll to top
 
246
                /// </summary>
 
247
                [Test()]
 
248
                public void TestBug4839 ()
 
249
                {
 
250
                        var editor = new TextEditorData ();
 
251
                        editor.Text = "1\n2\n3\n4\n5\n6\n7";
 
252
                        editor.Caret.Offset = editor.Text.Length;
 
253
                        var heightTree = new HeightTree (editor);
 
254
                        heightTree.Rebuild ();
 
255
                        MiscActions.InsertNewLine (editor);
 
256
                        Assert.AreEqual ((editor.LineCount - 1) * editor.LineHeight, heightTree.LineNumberToY (editor.LineCount));
 
257
                }
 
258
 
 
259
                [Test()]
 
260
                public void TestBug4839MultipleNewLines ()
 
261
                {
 
262
                        var editor = new TextEditorData ();
 
263
                        editor.Text = "1\n2\n3\n4\n5\n6\n7";
 
264
                        editor.Caret.Offset = editor.Text.Length;
 
265
                        var heightTree = new HeightTree (editor);
 
266
                        heightTree.Rebuild ();
 
267
                        MiscActions.InsertNewLine (editor);
 
268
                        MiscActions.InsertNewLine (editor);
 
269
                        Assert.AreEqual ((editor.LineCount - 1) * editor.LineHeight, heightTree.LineNumberToY (editor.LineCount));
 
270
                }
 
271
 
245
272
        }
246
273
}
247
274