File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -500,14 +500,15 @@ public async Task Uses_default_page_number_and_size()
500
500
501
501
Blog blog = _fakers . Blog . Generate ( ) ;
502
502
blog . Posts = _fakers . BlogPost . Generate ( 3 ) ;
503
+ blog . Posts . ToList ( ) . ForEach ( post => post . Labels = _fakers . Label . Generate ( 3 ) . ToHashSet ( ) ) ;
503
504
504
505
await _testContext . RunOnDatabaseAsync ( async dbContext =>
505
506
{
506
507
dbContext . Blogs . Add ( blog ) ;
507
508
await dbContext . SaveChangesAsync ( ) ;
508
509
} ) ;
509
510
510
- string route = $ "/blogs/{ blog . StringId } /posts";
511
+ string route = $ "/blogs/{ blog . StringId } /posts?include=labels ";
511
512
512
513
// Act
513
514
( HttpResponseMessage httpResponse , Document responseDocument ) = await _testContext . ExecuteGetAsync < Document > ( route ) ;
@@ -519,10 +520,12 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
519
520
responseDocument . Data . ManyValue [ 0 ] . Id . Should ( ) . Be ( blog . Posts [ 0 ] . StringId ) ;
520
521
responseDocument . Data . ManyValue [ 1 ] . Id . Should ( ) . Be ( blog . Posts [ 1 ] . StringId ) ;
521
522
523
+ responseDocument . Included . ShouldHaveCount ( 4 ) ;
524
+
522
525
responseDocument . Links . ShouldNotBeNull ( ) ;
523
526
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
524
527
responseDocument . Links . First . Should ( ) . Be ( responseDocument . Links . Self ) ;
525
- responseDocument . Links . Last . Should ( ) . Be ( $ "{ HostPrefix } { route } ? page%5Bnumber%5D=2") ;
528
+ responseDocument . Links . Last . Should ( ) . Be ( $ "{ responseDocument . Links . Self } & page%5Bnumber%5D=2") ;
526
529
responseDocument . Links . Prev . Should ( ) . BeNull ( ) ;
527
530
responseDocument . Links . Next . Should ( ) . Be ( responseDocument . Links . Last ) ;
528
531
}
You can’t perform that action at this time.
0 commit comments