@@ -16,7 +16,7 @@ public StreamMessageTests()
1616
1717 public void Dispose ( ) => _fixture . Dispose ( ) ;
1818 private readonly SqlStreamStoreHalMiddlewareFixture _fixture ;
19- private const string HeadOfStream = ".. /a-stream?d=b&m=20&p=-1&e=0" ;
19+ private const string HeadOfStream = "streams /a-stream?d=b&m=20&p=-1&e=0" ;
2020
2121 [ Fact ]
2222 public async Task read_single_message_stream ( )
@@ -30,24 +30,16 @@ public async Task read_single_message_stream()
3030
3131 var resource = await response.AsHal();
3232
33- resource.Links.Keys.ShouldBe(new[]
34- {
35- Constants . Relations . Self ,
36- Constants . Relations . First ,
37- Constants. Relations . Next ,
38- Constants. Relations . Last ,
39- Constants. Relations . Feed ,
40- Constants. Relations . Message ,
41- Constants. Relations . Find
42- } );
43-
44- resource.ShouldLink(Constants.Relations.Self, " 0 ") ;
45- resource. ShouldLink ( Constants . Relations . First , "0" ) ;
46- resource. ShouldLink ( Constants . Relations . Next , "1" ) ;
47- resource. ShouldLink ( Constants . Relations . Last , "-1" ) ;
48- resource. ShouldLink ( Constants . Relations . Feed , HeadOfStream ) ;
49- resource. ShouldLink ( Constants . Relations . Message , "0" ) ;
50- resource. ShouldLink ( Constants . Relations . Find , "../../streams/{streamId}" , "Find a Stream" ) ;
33+ resource.ShouldLink(Links
34+ .RootedAt(" ../ ../ ")
35+ . Index ( )
36+ . Find ( )
37+ . Add ( Constants . Relations . Self , "streams/a-stream/0" )
38+ . Add ( Constants . Relations . First , "streams/a-stream/0" )
39+ . Add ( Constants . Relations . Next , "streams/a-stream/1" )
40+ . Add ( Constants . Relations . Last , "streams/a-stream/-1" )
41+ . Add ( Constants . Relations . Feed , HeadOfStream )
42+ . Add ( Constants . Relations . Message , "streams/a-stream/0" ) ) ;
5143 }
5244 }
5345
@@ -61,22 +53,15 @@ public async Task read_single_message_does_not_exist_stream()
6153
6254 var resource = await response . AsHal ( ) ;
6355
64- resource. Links . Keys . ShouldBe ( new [ ]
65- {
66- Constants . Relations . Self ,
67- Constants . Relations . First ,
68- Constants . Relations . Last ,
69- Constants . Relations . Feed ,
70- Constants . Relations . Message ,
71- Constants . Relations . Find
72- } ) ;
73-
74- resource. ShouldLink ( Constants . Relations . Self , "0" ) ;
75- resource. ShouldLink ( Constants . Relations . First , "0" ) ;
76- resource. ShouldLink ( Constants . Relations . Last , "-1" ) ;
77- resource. ShouldLink ( Constants . Relations . Feed , HeadOfStream ) ;
78- resource. ShouldLink ( Constants . Relations . Message , "0" ) ;
79- resource. ShouldLink ( Constants . Relations . Find , "../../streams/{streamId}" , "Find a Stream" ) ;
56+ resource . ShouldLink ( Links
57+ . RootedAt ( "../../" )
58+ . Index ( )
59+ . Find ( )
60+ . Add ( Constants . Relations . Self , "streams/a-stream/0" )
61+ . Add ( Constants . Relations . First , "streams/a-stream/0" )
62+ . Add ( Constants . Relations . Last , "streams/a-stream/-1" )
63+ . Add ( Constants . Relations . Feed , HeadOfStream )
64+ . Add ( Constants . Relations . Message , "streams/a-stream/0" ) ) ;
8065 }
8166 }
8267
0 commit comments