@@ -65,8 +65,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
65
65
66
66
responseDocument . Links . ShouldNotBeNull ( ) ;
67
67
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
68
- responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogPosts?page[size] =1") ;
69
- responseDocument . Links . Last . Should ( ) . Be ( responseDocument . Links . Self ) ;
68
+ responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogPosts?page%5Bsize%5D =1") ;
69
+ responseDocument . Links . Last . Should ( ) . Be ( $ " { HostPrefix } /blogPosts?page%5Bnumber%5D=2&page%5Bsize%5D=1" ) ;
70
70
responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
71
71
responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
72
72
}
@@ -127,10 +127,10 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
127
127
128
128
responseDocument . Links . ShouldNotBeNull ( ) ;
129
129
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
130
- responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /posts?page[size] =1") ;
130
+ responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /posts?page%5Bsize%5D =1") ;
131
131
responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
132
132
responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
133
- responseDocument . Links . Next . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /posts?page[number] =3&page[size] =1") ;
133
+ responseDocument . Links . Next . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /posts?page%5Bnumber%5D =3&page%5Bsize%5D =1") ;
134
134
}
135
135
136
136
[ Fact ]
@@ -194,8 +194,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
194
194
195
195
responseDocument . Links . ShouldNotBeNull ( ) ;
196
196
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
197
- responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogs?include=posts&page[size] =2,posts:1 ") ;
198
- responseDocument . Links . Last . Should ( ) . Be ( $ "{ HostPrefix } /blogs?include=posts&page[number] =2&page[size] =2,posts:1 ") ;
197
+ responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogs?include=posts&page%5Bsize%5D =2,posts%3A1 ") ;
198
+ responseDocument . Links . Last . Should ( ) . Be ( $ "{ HostPrefix } /blogs?include=posts&page%5Bnumber%5D =2&page%5Bsize%5D =2,posts%3A1 ") ;
199
199
responseDocument . Links . Prev . Should ( ) . BeNull ( ) ;
200
200
responseDocument . Links . Next . Should ( ) . Be ( responseDocument . Links . Last ) ;
201
201
}
@@ -260,7 +260,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
260
260
261
261
responseDocument . Links . ShouldNotBeNull ( ) ;
262
262
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
263
- responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /relationships/posts?page[size] =1") ;
263
+ responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /relationships/posts?page%5Bsize%5D =1") ;
264
264
responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
265
265
responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
266
266
responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
@@ -302,7 +302,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
302
302
303
303
responseDocument . Links . ShouldNotBeNull ( ) ;
304
304
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
305
- responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogPosts?include=labels&page[size] =labels:1 ") ;
305
+ responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogPosts?include=labels&page%5Bsize%5D =labels%3A1 ") ;
306
306
responseDocument . Links . Last . Should ( ) . Be ( responseDocument . Links . First ) ;
307
307
responseDocument . Links . Prev . Should ( ) . BeNull ( ) ;
308
308
responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
@@ -335,7 +335,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
335
335
336
336
responseDocument . Links . ShouldNotBeNull ( ) ;
337
337
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
338
- responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogPosts/{ post . StringId } /relationships/labels?page[size] =1") ;
338
+ responseDocument . Links . First . Should ( ) . Be ( $ "{ HostPrefix } /blogPosts/{ post . StringId } /relationships/labels?page%5Bsize%5D =1") ;
339
339
responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
340
340
responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
341
341
responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
@@ -384,8 +384,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
384
384
385
385
responseDocument . Links . ShouldNotBeNull ( ) ;
386
386
responseDocument . Links . Self . Should ( ) . Be ( $ "{ HostPrefix } { route } ") ;
387
- responseDocument . Links . First . Should ( ) . Be ( $ "{ linkPrefix } &page[size] =1,owner.posts:1 ,owner.posts.comments:1 ") ;
388
- responseDocument . Links . Last . Should ( ) . Be ( $ "{ linkPrefix } &page[size] =1,owner.posts:1 ,owner.posts.comments:1 &page[number] =2") ;
387
+ responseDocument . Links . First . Should ( ) . Be ( $ "{ linkPrefix } &page%5Bsize%5D =1,owner.posts%3A1 ,owner.posts.comments%3A1 ") ;
388
+ responseDocument . Links . Last . Should ( ) . Be ( $ "{ linkPrefix } &page%5Bsize%5D =1,owner.posts%3A1 ,owner.posts.comments%3A1 &page%5Bnumber%5D =2") ;
389
389
responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
390
390
responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
391
391
}
@@ -467,7 +467,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
467
467
responseDocument . Links . First . Should ( ) . Be ( responseDocument . Links . Self ) ;
468
468
responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
469
469
responseDocument . Links . Prev . Should ( ) . BeNull ( ) ;
470
- responseDocument . Links . Next . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /posts?page[number] =2") ;
470
+ responseDocument . Links . Next . Should ( ) . Be ( $ "{ HostPrefix } /blogs/{ blog . StringId } /posts?page%5Bnumber%5D =2") ;
471
471
}
472
472
473
473
[ Fact ]
@@ -587,7 +587,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
587
587
588
588
static string SetPageNumberInUrl ( string url , int pageNumber )
589
589
{
590
- return pageNumber != 1 ? $ "{ url } &page[number]={ pageNumber } " : url ;
590
+ string link = pageNumber != 1 ? $ "{ url } &page[number]={ pageNumber } " : url ;
591
+ return link . Replace ( "[" , "%5B" ) . Replace ( "]" , "%5D" ) . Replace ( "'" , "%27" ) ;
591
592
}
592
593
}
593
594
}
0 commit comments