@@ -33,7 +33,7 @@ public abstract class TextTests : IDisposable
3333 [ Theory ]
3434 [ InlineData ( "loves" , 2 ) ]
3535 [ InlineData ( "shouldNotBeFound" , 0 ) ]
36- public async Task TextContainsgivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
36+ public async Task TextContainsGivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
3737 {
3838 var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
3939
@@ -42,11 +42,23 @@ public async Task TextContainsgivenSearchText_ExpectedCountOfElements(string sea
4242 Assert . Equal ( expectedCount , count ) ;
4343 }
4444
45+ [ Theory ]
46+ [ InlineData ( "loves" , 1 ) ]
47+ [ InlineData ( "shouldNotBeFound" , 3 ) ]
48+ public async Task TextNotContainsGivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
49+ {
50+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
51+
52+ var count = await g . E ( ) . Has ( "reason" , Text . TextNotContains ( searchText ) ) . Count ( ) . Promise ( t => t . Next ( ) ) ;
53+
54+ Assert . Equal ( expectedCount , count ) ;
55+ }
56+
4557 [ Theory ]
4658 [ InlineData ( "wave" , 1 ) ]
4759 [ InlineData ( "f" , 2 ) ]
4860 [ InlineData ( "shouldNotBeFound" , 0 ) ]
49- public async Task TextContainsPrefixgivenSearchText_ExpectedCountOfElements ( string searchText ,
61+ public async Task TextContainsPrefixGivenSearchText_ExpectedCountOfElements ( string searchText ,
5062 int expectedCount )
5163 {
5264 var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
@@ -56,11 +68,26 @@ public async Task TextContainsPrefixgivenSearchText_ExpectedCountOfElements(stri
5668 Assert . Equal ( expectedCount , count ) ;
5769 }
5870
71+ [ Theory ]
72+ [ InlineData ( "wave" , 2 ) ]
73+ [ InlineData ( "f" , 1 ) ]
74+ [ InlineData ( "shouldNotBeFound" , 3 ) ]
75+ public async Task TextNotContainsPrefixGivenSearchText_ExpectedCountOfElements ( string searchText ,
76+ int expectedCount )
77+ {
78+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
79+
80+ var count = await g . E ( ) . Has ( "reason" , Text . TextNotContainsPrefix ( searchText ) ) . Count ( )
81+ . Promise ( t => t . Next ( ) ) ;
82+
83+ Assert . Equal ( expectedCount , count ) ;
84+ }
85+
5986 [ Theory ]
6087 [ InlineData ( ".*ave.*" , 1 ) ]
6188 [ InlineData ( "f.{3,4}" , 2 ) ]
6289 [ InlineData ( "shouldNotBeFound" , 0 ) ]
63- public async Task TextContainsRegexgivenRegex_ExpectedCountOfElements ( string regex , int expectedCount )
90+ public async Task TextContainsRegexGivenRegex_ExpectedCountOfElements ( string regex , int expectedCount )
6491 {
6592 var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
6693
@@ -69,10 +96,23 @@ public async Task TextContainsRegexgivenRegex_ExpectedCountOfElements(string reg
6996 Assert . Equal ( expectedCount , count ) ;
7097 }
7198
99+ [ Theory ]
100+ [ InlineData ( ".*ave.*" , 2 ) ]
101+ [ InlineData ( "f.{3,4}" , 1 ) ]
102+ [ InlineData ( "shouldNotBeFound" , 3 ) ]
103+ public async Task TextNotContainsRegexGivenRegex_ExpectedCountOfElements ( string regex , int expectedCount )
104+ {
105+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
106+
107+ var count = await g . E ( ) . Has ( "reason" , Text . TextNotContainsRegex ( regex ) ) . Count ( ) . Promise ( t => t . Next ( ) ) ;
108+
109+ Assert . Equal ( expectedCount , count ) ;
110+ }
111+
72112 [ Theory ]
73113 [ InlineData ( "waxes" , 1 ) ]
74114 [ InlineData ( "shouldNotBeFound" , 0 ) ]
75- public async Task TextContainsFuzzygivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
115+ public async Task TextContainsFuzzyGivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
76116 {
77117 var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
78118
@@ -81,11 +121,55 @@ public async Task TextContainsFuzzygivenSearchText_ExpectedCountOfElements(strin
81121 Assert . Equal ( expectedCount , count ) ;
82122 }
83123
124+ [ Theory ]
125+ [ InlineData ( "waxes" , 2 ) ]
126+ [ InlineData ( "shouldNotBeFound" , 3 ) ]
127+ public async Task TextNotContainsFuzzyGivenSearchText_ExpectedCountOfElements ( string searchText ,
128+ int expectedCount )
129+ {
130+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
131+
132+ var count = await g . E ( ) . Has ( "reason" , Text . TextNotContainsFuzzy ( searchText ) ) . Count ( ) . Promise ( t => t . Next ( ) ) ;
133+
134+ Assert . Equal ( expectedCount , count ) ;
135+ }
136+
137+ [ Theory ]
138+ [ InlineData ( "fresh breezes" , 1 ) ]
139+ [ InlineData ( "no fear" , 1 ) ]
140+ [ InlineData ( "fear of" , 1 ) ]
141+ [ InlineData ( "shouldNotBeFound" , 0 ) ]
142+ public async Task TextContainsPhraseGivenSearchText_ExpectedCountOfElements ( string searchText ,
143+ int expectedCount )
144+ {
145+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
146+
147+ var count = await g . E ( ) . Has ( "reason" , Text . TextContainsPhrase ( searchText ) ) . Count ( ) . Promise ( t => t . Next ( ) ) ;
148+
149+ Assert . Equal ( expectedCount , count ) ;
150+ }
151+
152+ [ Theory ]
153+ [ InlineData ( "fresh breezes" , 2 ) ]
154+ [ InlineData ( "no fear" , 2 ) ]
155+ [ InlineData ( "fear of" , 2 ) ]
156+ [ InlineData ( "shouldNotBeFound" , 3 ) ]
157+ public async Task TextNotContainsPhraseGivenSearchText_ExpectedCountOfElements ( string searchText ,
158+ int expectedCount )
159+ {
160+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
161+
162+ var count = await g . E ( ) . Has ( "reason" , Text . TextNotContainsPhrase ( searchText ) ) . Count ( )
163+ . Promise ( t => t . Next ( ) ) ;
164+
165+ Assert . Equal ( expectedCount , count ) ;
166+ }
167+
84168 [ Theory ]
85169 [ InlineData ( "herc" , 1 ) ]
86170 [ InlineData ( "s" , 3 ) ]
87171 [ InlineData ( "shouldNotBeFound" , 0 ) ]
88- public async Task TextPrefixgivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
172+ public async Task TextPrefixGivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
89173 {
90174 var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
91175
@@ -94,11 +178,24 @@ public async Task TextPrefixgivenSearchText_ExpectedCountOfElements(string searc
94178 Assert . Equal ( expectedCount , count ) ;
95179 }
96180
181+ [ Theory ]
182+ [ InlineData ( "herc" , 11 ) ]
183+ [ InlineData ( "s" , 9 ) ]
184+ [ InlineData ( "shouldNotBeFound" , 12 ) ]
185+ public async Task TextNotPrefixGivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
186+ {
187+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
188+
189+ var count = await g . V ( ) . Has ( "name" , Text . TextNotPrefix ( searchText ) ) . Count ( ) . Promise ( t => t . Next ( ) ) ;
190+
191+ Assert . Equal ( expectedCount , count ) ;
192+ }
193+
97194 [ Theory ]
98195 [ InlineData ( ".*rcule.*" , 1 ) ]
99196 [ InlineData ( "s.{2}" , 2 ) ]
100197 [ InlineData ( "shouldNotBeFound" , 0 ) ]
101- public async Task TextRegexgivenRegex_ExpectedCountOfElements ( string regex , int expectedCount )
198+ public async Task TextRegexGivenRegex_ExpectedCountOfElements ( string regex , int expectedCount )
102199 {
103200 var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
104201
@@ -107,11 +204,24 @@ public async Task TextRegexgivenRegex_ExpectedCountOfElements(string regex, int
107204 Assert . Equal ( expectedCount , count ) ;
108205 }
109206
207+ [ Theory ]
208+ [ InlineData ( ".*rcule.*" , 11 ) ]
209+ [ InlineData ( "s.{2}" , 10 ) ]
210+ [ InlineData ( "shouldNotBeFound" , 12 ) ]
211+ public async Task TextNotRegexGivenRegex_ExpectedCountOfElements ( string regex , int expectedCount )
212+ {
213+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
214+
215+ var count = await g . V ( ) . Has ( "name" , Text . TextNotRegex ( regex ) ) . Count ( ) . Promise ( t => t . Next ( ) ) ;
216+
217+ Assert . Equal ( expectedCount , count ) ;
218+ }
219+
110220 [ Theory ]
111221 [ InlineData ( "herculex" , 1 ) ]
112222 [ InlineData ( "ska" , 2 ) ]
113223 [ InlineData ( "shouldNotBeFound" , 0 ) ]
114- public async Task TextFuzzygivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
224+ public async Task TextFuzzyGivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
115225 {
116226 var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
117227
@@ -120,6 +230,19 @@ public async Task TextFuzzygivenSearchText_ExpectedCountOfElements(string search
120230 Assert . Equal ( expectedCount , count ) ;
121231 }
122232
233+ [ Theory ]
234+ [ InlineData ( "herculex" , 11 ) ]
235+ [ InlineData ( "ska" , 10 ) ]
236+ [ InlineData ( "shouldNotBeFound" , 12 ) ]
237+ public async Task TextNotFuzzyGivenSearchText_ExpectedCountOfElements ( string searchText , int expectedCount )
238+ {
239+ var g = Traversal ( ) . WithRemote ( ConnectionFactory . CreateRemoteConnection ( ) ) ;
240+
241+ var count = await g . V ( ) . Has ( "name" , Text . TextNotFuzzy ( searchText ) ) . Count ( ) . Promise ( t => t . Next ( ) ) ;
242+
243+ Assert . Equal ( expectedCount , count ) ;
244+ }
245+
123246 public void Dispose ( )
124247 {
125248 ConnectionFactory ? . Dispose ( ) ;
0 commit comments