@@ -168,20 +168,20 @@ public async Task Can_use_multiple_operations()
168
168
// Assert
169
169
httpResponse . ShouldHaveStatusCode ( HttpStatusCode . OK ) ;
170
170
171
- responseDocument . Results . ShouldHaveCount ( 7 ) ;
171
+ responseDocument . Results . Should ( ) . HaveCount ( 7 ) ;
172
172
173
- responseDocument . Results [ 0 ] . Data . SingleValue . ShouldNotBeNull ( ) . With ( resource => resource . Type . Should ( ) . Be ( "people" ) ) ;
174
- responseDocument . Results [ 1 ] . Data . SingleValue . ShouldNotBeNull ( ) . With ( resource => resource . Type . Should ( ) . Be ( "people" ) ) ;
175
- responseDocument . Results [ 2 ] . Data . SingleValue . ShouldNotBeNull ( ) . With ( resource => resource . Type . Should ( ) . Be ( "tags" ) ) ;
176
- responseDocument . Results [ 3 ] . Data . SingleValue . ShouldNotBeNull ( ) . With ( resource => resource . Type . Should ( ) . Be ( "todoItems" ) ) ;
173
+ responseDocument . Results [ 0 ] . Data . SingleValue . RefShould ( ) . NotBeNull ( ) . And . Subject . Type . Should ( ) . Be ( "people" ) ;
174
+ responseDocument . Results [ 1 ] . Data . SingleValue . RefShould ( ) . NotBeNull ( ) . And . Subject . Type . Should ( ) . Be ( "people" ) ;
175
+ responseDocument . Results [ 2 ] . Data . SingleValue . RefShould ( ) . NotBeNull ( ) . And . Subject . Type . Should ( ) . Be ( "tags" ) ;
176
+ responseDocument . Results [ 3 ] . Data . SingleValue . RefShould ( ) . NotBeNull ( ) . And . Subject . Type . Should ( ) . Be ( "todoItems" ) ;
177
177
responseDocument . Results [ 4 ] . Data . Value . Should ( ) . BeNull ( ) ;
178
- responseDocument . Results [ 5 ] . Data . SingleValue . ShouldNotBeNull ( ) . With ( resource => resource . Type . Should ( ) . Be ( "todoItems" ) ) ;
178
+ responseDocument . Results [ 5 ] . Data . SingleValue . RefShould ( ) . NotBeNull ( ) . And . Subject . Type . Should ( ) . Be ( "todoItems" ) ;
179
179
responseDocument . Results [ 6 ] . Data . Value . Should ( ) . BeNull ( ) ;
180
180
181
- long newOwnerId = long . Parse ( responseDocument . Results [ 0 ] . Data . SingleValue ! . Id . ShouldNotBeNull ( ) ) ;
182
- long newAssigneeId = long . Parse ( responseDocument . Results [ 1 ] . Data . SingleValue ! . Id . ShouldNotBeNull ( ) ) ;
183
- long newTagId = long . Parse ( responseDocument . Results [ 2 ] . Data . SingleValue ! . Id . ShouldNotBeNull ( ) ) ;
184
- long newTodoItemId = long . Parse ( responseDocument . Results [ 3 ] . Data . SingleValue ! . Id . ShouldNotBeNull ( ) ) ;
181
+ long newOwnerId = long . Parse ( responseDocument . Results [ 0 ] . Data . SingleValue ! . Id . Should ( ) . NotBeNull ( ) . And . Subject ) ;
182
+ long newAssigneeId = long . Parse ( responseDocument . Results [ 1 ] . Data . SingleValue ! . Id . Should ( ) . NotBeNull ( ) . And . Subject ) ;
183
+ long newTagId = long . Parse ( responseDocument . Results [ 2 ] . Data . SingleValue ! . Id . Should ( ) . NotBeNull ( ) . And . Subject ) ;
184
+ long newTodoItemId = long . Parse ( responseDocument . Results [ 3 ] . Data . SingleValue ! . Id . Should ( ) . NotBeNull ( ) . And . Subject ) ;
185
185
186
186
await _testContext . RunOnDatabaseAsync ( async dbContext =>
187
187
{
@@ -203,14 +203,14 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
203
203
todoItemInDatabase . CreatedAt . Should ( ) . Be ( DapperTestContext . FrozenTime ) ;
204
204
todoItemInDatabase . LastModifiedAt . Should ( ) . Be ( DapperTestContext . FrozenTime ) ;
205
205
206
- todoItemInDatabase . Owner . ShouldNotBeNull ( ) ;
206
+ todoItemInDatabase . Owner . Should ( ) . NotBeNull ( ) ;
207
207
todoItemInDatabase . Owner . Id . Should ( ) . Be ( newOwnerId ) ;
208
208
todoItemInDatabase . Assignee . Should ( ) . BeNull ( ) ;
209
- todoItemInDatabase . Tags . ShouldHaveCount ( 1 ) ;
209
+ todoItemInDatabase . Tags . Should ( ) . HaveCount ( 1 ) ;
210
210
todoItemInDatabase . Tags . ElementAt ( 0 ) . Id . Should ( ) . Be ( newTagId ) ;
211
211
} ) ;
212
212
213
- store . SqlCommands . ShouldHaveCount ( 15 ) ;
213
+ store . SqlCommands . Should ( ) . HaveCount ( 15 ) ;
214
214
215
215
store . SqlCommands [ 0 ] . With ( command =>
216
216
{
@@ -220,7 +220,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
220
220
RETURNING "Id"
221
221
""" ) ) ;
222
222
223
- command . Parameters . ShouldHaveCount ( 3 ) ;
223
+ command . Parameters . Should ( ) . HaveCount ( 3 ) ;
224
224
command . Parameters . Should ( ) . Contain ( "@p1" , newOwner . FirstName ) ;
225
225
command . Parameters . Should ( ) . Contain ( "@p2" , newOwner . LastName ) ;
226
226
command . Parameters . Should ( ) . Contain ( "@p3" , null ) ;
@@ -234,7 +234,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
234
234
WHERE t1."Id" = @p1
235
235
""" ) ) ;
236
236
237
- command . Parameters . ShouldHaveCount ( 1 ) ;
237
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
238
238
command . Parameters . Should ( ) . Contain ( "@p1" , newOwnerId ) ;
239
239
} ) ;
240
240
@@ -246,7 +246,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
246
246
RETURNING "Id"
247
247
""" ) ) ;
248
248
249
- command . Parameters . ShouldHaveCount ( 3 ) ;
249
+ command . Parameters . Should ( ) . HaveCount ( 3 ) ;
250
250
command . Parameters . Should ( ) . Contain ( "@p1" , newAssignee . FirstName ) ;
251
251
command . Parameters . Should ( ) . Contain ( "@p2" , newAssignee . LastName ) ;
252
252
command . Parameters . Should ( ) . Contain ( "@p3" , null ) ;
@@ -260,7 +260,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
260
260
WHERE t1."Id" = @p1
261
261
""" ) ) ;
262
262
263
- command . Parameters . ShouldHaveCount ( 1 ) ;
263
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
264
264
command . Parameters . Should ( ) . Contain ( "@p1" , newAssigneeId ) ;
265
265
} ) ;
266
266
@@ -272,7 +272,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
272
272
RETURNING "Id"
273
273
""" ) ) ;
274
274
275
- command . Parameters . ShouldHaveCount ( 2 ) ;
275
+ command . Parameters . Should ( ) . HaveCount ( 2 ) ;
276
276
command . Parameters . Should ( ) . Contain ( "@p1" , newTag . Name ) ;
277
277
command . Parameters . Should ( ) . Contain ( "@p2" , null ) ;
278
278
} ) ;
@@ -285,7 +285,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
285
285
WHERE t1."Id" = @p1
286
286
""" ) ) ;
287
287
288
- command . Parameters . ShouldHaveCount ( 1 ) ;
288
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
289
289
command . Parameters . Should ( ) . Contain ( "@p1" , newTagId ) ;
290
290
} ) ;
291
291
@@ -297,7 +297,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
297
297
RETURNING "Id"
298
298
""" ) ) ;
299
299
300
- command . Parameters . ShouldHaveCount ( 7 ) ;
300
+ command . Parameters . Should ( ) . HaveCount ( 7 ) ;
301
301
command . Parameters . Should ( ) . Contain ( "@p1" , newTodoItem . Description ) ;
302
302
command . Parameters . Should ( ) . Contain ( "@p2" , newTodoItem . Priority ) ;
303
303
command . Parameters . Should ( ) . Contain ( "@p3" , newTodoItem . DurationInHours ) ;
@@ -315,7 +315,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
315
315
WHERE t1."Id" = @p1
316
316
""" ) ) ;
317
317
318
- command . Parameters . ShouldHaveCount ( 1 ) ;
318
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
319
319
command . Parameters . Should ( ) . Contain ( "@p1" , newTodoItemId ) ;
320
320
} ) ;
321
321
@@ -328,7 +328,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
328
328
WHERE t1."Id" = @p1
329
329
""" ) ) ;
330
330
331
- command . Parameters . ShouldHaveCount ( 1 ) ;
331
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
332
332
command . Parameters . Should ( ) . Contain ( "@p1" , newTodoItemId ) ;
333
333
} ) ;
334
334
@@ -340,7 +340,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
340
340
WHERE "Id" = @p2
341
341
""" ) ) ;
342
342
343
- command . Parameters . ShouldHaveCount ( 2 ) ;
343
+ command . Parameters . Should ( ) . HaveCount ( 2 ) ;
344
344
command . Parameters . Should ( ) . Contain ( "@p1" , newAssigneeId ) ;
345
345
command . Parameters . Should ( ) . Contain ( "@p2" , newTodoItemId ) ;
346
346
} ) ;
@@ -354,7 +354,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
354
354
WHERE t1."Id" = @p1
355
355
""" ) ) ;
356
356
357
- command . Parameters . ShouldHaveCount ( 1 ) ;
357
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
358
358
command . Parameters . Should ( ) . Contain ( "@p1" , newTodoItemId ) ;
359
359
} ) ;
360
360
@@ -366,7 +366,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
366
366
WHERE "Id" = @p2
367
367
""" ) ) ;
368
368
369
- command . Parameters . ShouldHaveCount ( 2 ) ;
369
+ command . Parameters . Should ( ) . HaveCount ( 2 ) ;
370
370
command . Parameters . Should ( ) . Contain ( "@p1" , DapperTestContext . FrozenTime ) ;
371
371
command . Parameters . Should ( ) . Contain ( "@p2" , newTodoItemId ) ;
372
372
} ) ;
@@ -379,7 +379,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
379
379
WHERE "Id" = @p2
380
380
""" ) ) ;
381
381
382
- command . Parameters . ShouldHaveCount ( 2 ) ;
382
+ command . Parameters . Should ( ) . HaveCount ( 2 ) ;
383
383
command . Parameters . Should ( ) . Contain ( "@p1" , newTodoItemId ) ;
384
384
command . Parameters . Should ( ) . Contain ( "@p2" , newTagId ) ;
385
385
} ) ;
@@ -392,7 +392,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
392
392
WHERE t1."Id" = @p1
393
393
""" ) ) ;
394
394
395
- command . Parameters . ShouldHaveCount ( 1 ) ;
395
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
396
396
command . Parameters . Should ( ) . Contain ( "@p1" , newTodoItemId ) ;
397
397
} ) ;
398
398
@@ -403,7 +403,7 @@ DELETE FROM "People"
403
403
WHERE "Id" = @p1
404
404
""" ) ) ;
405
405
406
- command . Parameters . ShouldHaveCount ( 1 ) ;
406
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
407
407
command . Parameters . Should ( ) . Contain ( "@p1" , newAssigneeId ) ;
408
408
} ) ;
409
409
}
@@ -469,13 +469,13 @@ public async Task Can_rollback_on_error()
469
469
// Assert
470
470
httpResponse . ShouldHaveStatusCode ( HttpStatusCode . NotFound ) ;
471
471
472
- responseDocument . Errors . ShouldHaveCount ( 1 ) ;
472
+ responseDocument . Errors . Should ( ) . HaveCount ( 1 ) ;
473
473
474
474
ErrorObject error = responseDocument . Errors [ 0 ] ;
475
475
error . StatusCode . Should ( ) . Be ( HttpStatusCode . NotFound ) ;
476
476
error . Title . Should ( ) . Be ( "A related resource does not exist." ) ;
477
477
error . Detail . Should ( ) . Be ( $ "Related resource of type 'todoItems' with ID '{ unknownTodoItemId } ' in relationship 'assignedTodoItems' does not exist.") ;
478
- error . Source . ShouldNotBeNull ( ) ;
478
+ error . Source . Should ( ) . NotBeNull ( ) ;
479
479
error . Source . Pointer . Should ( ) . Be ( "/atomic:operations[1]" ) ;
480
480
481
481
await _testContext . RunOnDatabaseAsync ( async dbContext =>
@@ -484,7 +484,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
484
484
peopleInDatabase . Should ( ) . BeEmpty ( ) ;
485
485
} ) ;
486
486
487
- store . SqlCommands . ShouldHaveCount ( 5 ) ;
487
+ store . SqlCommands . Should ( ) . HaveCount ( 5 ) ;
488
488
489
489
store . SqlCommands [ 0 ] . With ( command =>
490
490
{
@@ -494,7 +494,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
494
494
RETURNING "Id"
495
495
""" ) ) ;
496
496
497
- command . Parameters . ShouldHaveCount ( 3 ) ;
497
+ command . Parameters . Should ( ) . HaveCount ( 3 ) ;
498
498
command . Parameters . Should ( ) . Contain ( "@p1" , null ) ;
499
499
command . Parameters . Should ( ) . Contain ( "@p2" , newPerson . LastName ) ;
500
500
command . Parameters . Should ( ) . Contain ( "@p3" , null ) ;
@@ -508,8 +508,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
508
508
WHERE t1."Id" = @p1
509
509
""" ) ) ;
510
510
511
- command . Parameters . ShouldHaveCount ( 1 ) ;
512
- command . Parameters . ShouldContainKey ( "@p1" ) . With ( value => value . ShouldNotBeNull ( ) ) ;
511
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
512
+ command . Parameters . Should ( ) . ContainKey ( "@p1" ) . WhoseValue . Should ( ) . NotBeNull ( ) ;
513
513
} ) ;
514
514
515
515
store . SqlCommands [ 2 ] . With ( command =>
@@ -521,8 +521,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
521
521
WHERE t1."Id" = @p1
522
522
""" ) ) ;
523
523
524
- command . Parameters . ShouldHaveCount ( 1 ) ;
525
- command . Parameters . ShouldContainKey ( "@p1" ) . With ( value => value . ShouldNotBeNull ( ) ) ;
524
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
525
+ command . Parameters . Should ( ) . ContainKey ( "@p1" ) . WhoseValue . Should ( ) . NotBeNull ( ) ;
526
526
} ) ;
527
527
528
528
store . SqlCommands [ 3 ] . With ( command =>
@@ -533,8 +533,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
533
533
WHERE "Id" = @p2
534
534
""" ) ) ;
535
535
536
- command . Parameters . ShouldHaveCount ( 2 ) ;
537
- command . Parameters . ShouldContainKey ( "@p1" ) . With ( value => value . ShouldNotBeNull ( ) ) ;
536
+ command . Parameters . Should ( ) . HaveCount ( 2 ) ;
537
+ command . Parameters . Should ( ) . ContainKey ( "@p1" ) . WhoseValue . Should ( ) . NotBeNull ( ) ;
538
538
command . Parameters . Should ( ) . Contain ( "@p2" , unknownTodoItemId ) ;
539
539
} ) ;
540
540
@@ -546,7 +546,7 @@ SELECT t1."Id"
546
546
WHERE t1."Id" = @p1
547
547
""" ) ) ;
548
548
549
- command . Parameters . ShouldHaveCount ( 1 ) ;
549
+ command . Parameters . Should ( ) . HaveCount ( 1 ) ;
550
550
command . Parameters . Should ( ) . Contain ( "@p1" , unknownTodoItemId ) ;
551
551
} ) ;
552
552
}
0 commit comments