@@ -65,8 +65,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
6565
6666 responseDocument . Links . ShouldNotBeNull ( ) ;
6767 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" ) ;
7070 responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
7171 responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
7272 }
@@ -127,10 +127,10 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
127127
128128 responseDocument . Links . ShouldNotBeNull ( ) ;
129129 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") ;
131131 responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
132132 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") ;
134134 }
135135
136136 [ Fact ]
@@ -194,8 +194,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
194194
195195 responseDocument . Links . ShouldNotBeNull ( ) ;
196196 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 ") ;
199199 responseDocument . Links . Prev . Should ( ) . BeNull ( ) ;
200200 responseDocument . Links . Next . Should ( ) . Be ( responseDocument . Links . Last ) ;
201201 }
@@ -260,7 +260,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
260260
261261 responseDocument . Links . ShouldNotBeNull ( ) ;
262262 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") ;
264264 responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
265265 responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
266266 responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
@@ -302,7 +302,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
302302
303303 responseDocument . Links . ShouldNotBeNull ( ) ;
304304 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 ") ;
306306 responseDocument . Links . Last . Should ( ) . Be ( responseDocument . Links . First ) ;
307307 responseDocument . Links . Prev . Should ( ) . BeNull ( ) ;
308308 responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
@@ -335,7 +335,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
335335
336336 responseDocument . Links . ShouldNotBeNull ( ) ;
337337 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") ;
339339 responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
340340 responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
341341 responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
@@ -384,8 +384,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
384384
385385 responseDocument . Links . ShouldNotBeNull ( ) ;
386386 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") ;
389389 responseDocument . Links . Prev . Should ( ) . Be ( responseDocument . Links . First ) ;
390390 responseDocument . Links . Next . Should ( ) . BeNull ( ) ;
391391 }
@@ -467,7 +467,7 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
467467 responseDocument . Links . First . Should ( ) . Be ( responseDocument . Links . Self ) ;
468468 responseDocument . Links . Last . Should ( ) . BeNull ( ) ;
469469 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") ;
471471 }
472472
473473 [ Fact ]
@@ -587,7 +587,8 @@ await _testContext.RunOnDatabaseAsync(async dbContext =>
587587
588588 static string SetPageNumberInUrl ( string url , int pageNumber )
589589 {
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" ) ;
591592 }
592593 }
593594 }
0 commit comments