@@ -15,10 +15,19 @@ public void ExclusivePluginQueryTest()
15
15
{ ">" , new PluginPair { Metadata = new PluginMetadata { ActionKeywords = new List < string > { ">" } } } }
16
16
} ;
17
17
18
- Query q = QueryBuilder . Build ( "> file.txt file2 file3 " , nonGlobalPlugins ) ;
18
+ Query q = QueryBuilder . Build ( "> ping google.com -n 20 -6 " , nonGlobalPlugins ) ;
19
19
20
- Assert . AreEqual ( "file.txt file2 file3" , q . Search ) ;
20
+ Assert . AreEqual ( "> ping google.com -n 20 -6" , q . RawQuery ) ;
21
+ Assert . AreEqual ( "ping google.com -n 20 -6" , q . Search , "Search should not start with the ActionKeyword." ) ;
21
22
Assert . AreEqual ( ">" , q . ActionKeyword ) ;
23
+
24
+ Assert . AreEqual ( 5 , q . SearchTerms . Length , "The length of SearchTerms should match." ) ;
25
+
26
+ Assert . AreEqual ( "ping" , q . FirstSearch ) ;
27
+ Assert . AreEqual ( "google.com" , q . SecondSearch ) ;
28
+ Assert . AreEqual ( "-n" , q . ThirdSearch ) ;
29
+
30
+ Assert . AreEqual ( "google.com -n 20 -6" , q . SecondToEndSearch , "SecondToEndSearch should be trimmed of multiple whitespace characters" ) ;
22
31
}
23
32
24
33
[ Test ]
@@ -29,9 +38,13 @@ public void ExclusivePluginQueryIgnoreDisabledTest()
29
38
{ ">" , new PluginPair { Metadata = new PluginMetadata { ActionKeywords = new List < string > { ">" } , Disabled = true } } }
30
39
} ;
31
40
32
- Query q = QueryBuilder . Build ( "> file.txt file2 file3 " , nonGlobalPlugins ) ;
41
+ Query q = QueryBuilder . Build ( "> ping google.com -n 20 -6 " , nonGlobalPlugins ) ;
33
42
34
- Assert . AreEqual ( "> file.txt file2 file3" , q . Search ) ;
43
+ Assert . AreEqual ( "> ping google.com -n 20 -6" , q . Search ) ;
44
+ Assert . AreEqual ( q . Search , q . RawQuery , "RawQuery should be equal to Search." ) ;
45
+ Assert . AreEqual ( 6 , q . SearchTerms . Length , "The length of SearchTerms should match." ) ;
46
+ Assert . AreNotEqual ( ">" , q . ActionKeyword , "ActionKeyword should not match that of a disabled plugin." ) ;
47
+ Assert . AreEqual ( "ping google.com -n 20 -6" , q . SecondToEndSearch , "SecondToEndSearch should be trimmed of multiple whitespace characters" ) ;
35
48
}
36
49
37
50
[ Test ]
0 commit comments