@@ -11,27 +11,28 @@ public class TagsStepDefinitions
11
11
{
12
12
private readonly ResponseContext _responseContext ;
13
13
private readonly ClientPool _clientPool ;
14
- private readonly TagsContext _tagsContext ;
15
14
16
15
private CachedApiResponse < ListTagsResponse > ? _listTagsResponse ;
17
16
18
17
public TagsStepDefinitions ( ResponseContext responseContext , ClientPool clientPool )
19
18
{
20
19
_responseContext = responseContext ;
21
20
_clientPool = clientPool ;
22
- _tagsContext = new TagsContext ( ) ;
23
21
}
24
22
25
23
#region Given
26
24
27
- [ Given ( $@ "the most current hash { RegexFor . SINGLE_THING } ") ]
28
- public async Task GivenTheMostCurrentHash ( string hash )
25
+ [ Given ( $@ "a list of tags { RegexFor . SINGLE_THING } with an ETag { RegexFor . SINGLE_THING } ") ]
26
+ public async Task GivenAListOfTagsWithETag ( string list , string hash )
29
27
{
30
28
await WhenAGETRequestToTheTagsEndpointGetsSent ( ) ;
31
29
32
30
_listTagsResponse ! . Should ( ) . BeASuccess ( ) ;
31
+ }
33
32
34
- _tagsContext . TagHashes [ hash ] = _listTagsResponse ! . ETag ;
33
+ [ Given ( "I didn't change since the last fetch" ) ]
34
+ public void GivenIDidntChangeSinceLastFetch ( )
35
+ {
35
36
}
36
37
37
38
#endregion
@@ -46,11 +47,11 @@ public async Task WhenAGETRequestToTheTagsEndpointGetsSent()
46
47
_responseContext . WhenResponse = _listTagsResponse = await client . Tags . ListTags ( ) ;
47
48
}
48
49
49
- [ When ( $@ "A GET request to the /Tags endpoint gets sent with hash { RegexFor . SINGLE_THING } ") ]
50
+ [ When ( $@ "A GET request to the /Tags endpoint gets sent with the If-None-Match header set to { RegexFor . SINGLE_THING } ") ]
50
51
public async Task WhenAGETRequestToTheTagsEndpointGetsSentWithHash ( string hash )
51
52
{
52
53
var client = _clientPool . Anonymous ;
53
- _responseContext . WhenResponse = _listTagsResponse = await client . Tags . ListTags ( new CacheControl { ETag = _tagsContext . TagHashes [ hash ] } ) ;
54
+ _responseContext . WhenResponse = _listTagsResponse = await client . Tags . ListTags ( new CacheControl { ETag = _listTagsResponse ! . ETag } ) ;
54
55
}
55
56
56
57
#endregion
@@ -72,5 +73,12 @@ public void AndTheResponseAttributesContainTags()
72
73
}
73
74
}
74
75
76
+ [ Then ( "the response content is empty" ) ]
77
+ public void ThenTheResponseContentIsEmpty ( )
78
+ {
79
+ _listTagsResponse ! . NotModified . Should ( ) . BeTrue ( ) ;
80
+ _listTagsResponse ! . Result . Should ( ) . BeNull ( ) ;
81
+ }
82
+
75
83
#endregion
76
84
}
0 commit comments