Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Krüger <mkrueger@xamarin.com>2012-09-19 13:18:26 +0400
committerMike Krüger <mkrueger@xamarin.com>2012-09-19 13:49:48 +0400
commitd88a360517f4574462af2934e20528c5ce118b7b (patch)
treebd72c3eb4853c8f84a8585cbcb85828b0e9732f2 /main/tests/UnitTests/MonoDevelop.Ide.Gui
parentebe04ed4bf447653d33f5a6ce70d8bb15939e591 (diff)
[UIRefresh] Implemented navigate to command tags/Fixed 'Bug 7059 - On
clicking 'Search' menu, the following options: 'Go to File', 'Go to Type' and 'Navigate TO' are not appearing.'.
Diffstat (limited to 'main/tests/UnitTests/MonoDevelop.Ide.Gui')
-rw-r--r--main/tests/UnitTests/MonoDevelop.Ide.Gui/SearchPopupWindowTests.cs100
1 files changed, 100 insertions, 0 deletions
diff --git a/main/tests/UnitTests/MonoDevelop.Ide.Gui/SearchPopupWindowTests.cs b/main/tests/UnitTests/MonoDevelop.Ide.Gui/SearchPopupWindowTests.cs
new file mode 100644
index 0000000000..2d00387803
--- /dev/null
+++ b/main/tests/UnitTests/MonoDevelop.Ide.Gui/SearchPopupWindowTests.cs
@@ -0,0 +1,100 @@
+//
+// SearchPopupWindowTests.cs
+//
+// Author:
+// Mike Krüger <mkrueger@xamarin.com>
+//
+// Copyright (c) 2012 Xamarin Inc. (http://xamarin.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+using System;
+using MonoDevelop.Components.MainToolbar;
+using NUnit.Framework;
+
+namespace MonoDevelop.Ide.Gui
+{
+ [TestFixture()]
+ public class SearchPopupWindowTests
+ {
+ [Test()]
+ public void TestEmptyPattern ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("");
+ Assert.AreEqual (new SearchPopupSearchPattern (null, "", -1), pattern);
+ }
+
+ [Test()]
+ public void TestSimplePattern ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("foo");
+ Assert.AreEqual (new SearchPopupSearchPattern (null, "foo", -1), pattern);
+ }
+
+ [Test()]
+ public void TestLineNumber ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("foo:4711");
+ Assert.AreEqual (new SearchPopupSearchPattern (null, "foo", 4711), pattern);
+ }
+
+ [Test()]
+ public void TestEmptySecondPart ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("foo:");
+ Assert.AreEqual (new SearchPopupSearchPattern ("foo", "", -1), pattern);
+ }
+
+ [Test()]
+ public void TestEmptyThirdPart ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("foo:bar:");
+ Assert.AreEqual (new SearchPopupSearchPattern ("foo", "bar", 0), pattern);
+ }
+
+
+ [Test()]
+ public void TestLineNumberOnly ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern (":4711");
+ Assert.AreEqual (new SearchPopupSearchPattern (null, null, 4711), pattern);
+ }
+
+ [Test()]
+ public void TestCategory ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("cat:foo");
+ Assert.AreEqual (new SearchPopupSearchPattern ("cat", "foo", -1), pattern);
+ }
+
+ [Test()]
+ public void TestCategoryAndLineNumber ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("cat:foo:1337");
+ Assert.AreEqual (new SearchPopupSearchPattern ("cat", "foo", 1337), pattern);
+ }
+
+ [Test()]
+ public void TestInvalidLineNumber ()
+ {
+ var pattern = SearchPopupSearchPattern.ParsePattern ("cat:foo:bar");
+ Assert.AreEqual (new SearchPopupSearchPattern ("cat", "foo", 0), pattern);
+ }
+ }
+}
+