@@ -155,30 +155,65 @@ await Assert.ThrowsAsync<CreateStreamException>(
155
155
156
156
[ Fact ]
157
157
[ WaitTestBeforeAfter ]
158
- public async void ValidateQuery ( )
158
+ public async void ValidateQueryOffset ( )
159
159
{
160
160
// here we just validate the Query for Offset and Sequence
161
161
// if the reference is == "" return must be 0
162
162
// stream name is mandatory
163
163
var config = new StreamSystemConfig ( ) ;
164
164
var system = await StreamSystem . Create ( config ) ;
165
- var res = await system . QueryOffset ( "" , "stream_we_don_t_care" ) ;
166
- Assert . True ( res == 0 ) ;
167
165
168
- res = await system . QuerySequence ( "" , "stream_we_don_t_care" ) ;
169
- Assert . True ( res == 0 ) ;
166
+ await Assert . ThrowsAsync < QueryException > (
167
+ async ( ) =>
168
+ {
169
+ await system . QueryOffset ( string . Empty , "stream_we_don_t_care" ) ;
170
+ }
171
+ ) ;
172
+
173
+ await Assert . ThrowsAsync < QueryException > (
174
+ async ( ) =>
175
+ {
176
+ await system . QueryOffset ( "reference_we_don_care" , string . Empty ) ;
177
+ }
178
+ ) ;
179
+
180
+ await Assert . ThrowsAsync < QueryException > (
181
+ async ( ) =>
182
+ {
183
+ await system . QueryOffset ( string . Empty , string . Empty ) ;
184
+ }
185
+ ) ;
186
+ await system . Close ( ) ;
187
+ }
188
+
189
+ [ Fact ]
190
+ [ WaitTestBeforeAfter ]
191
+ public async void ValidateQuerySequence ( )
192
+ {
193
+ // here we just validate the Query for Offset and Sequence
194
+ // if the reference is == "" return must be 0
195
+ // stream name is mandatory
196
+ var config = new StreamSystemConfig ( ) ;
197
+ var system = await StreamSystem . Create ( config ) ;
198
+
199
+ await Assert . ThrowsAsync < QueryException > (
200
+ async ( ) =>
201
+ {
202
+ await system . QuerySequence ( string . Empty , "stream_we_don_t_care" ) ;
203
+ }
204
+ ) ;
170
205
171
206
await Assert . ThrowsAsync < QueryException > (
172
207
async ( ) =>
173
208
{
174
- await system . QueryOffset ( "reference_we_don_care" , "" ) ;
209
+ await system . QuerySequence ( "reference_we_don_care" , string . Empty ) ;
175
210
}
176
211
) ;
177
212
178
213
await Assert . ThrowsAsync < QueryException > (
179
214
async ( ) =>
180
215
{
181
- await system . QuerySequence ( "reference_we_don_care" , "" ) ;
216
+ await system . QuerySequence ( string . Empty , string . Empty ) ;
182
217
}
183
218
) ;
184
219
await system . Close ( ) ;
0 commit comments