Skip to content

Commit 61ee165

Browse files
committed
Add SimulateRetryAfter
1 parent ea7ef9a commit 61ee165

12 files changed

+534
-6
lines changed

src/Devlead.Testing.MockHttp.Tests/Devlead.Testing.MockHttp.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<PackageReference Include="Verify.NUnit" />
3030
<PackageReference Include="System.Text.Json" />
3131
<PackageReference Include="Verify.Http" />
32+
<PackageReference Include="Microsoft.Extensions.TimeProvider.Testing" />
3233
</ItemGroup>
3334

3435
<ItemGroup>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[
2+
{
3+
Version: 1.1,
4+
Content: {
5+
Headers: [
6+
{
7+
Content-Length: [
8+
0
9+
]
10+
}
11+
]
12+
},
13+
StatusCode: TooManyRequests,
14+
ReasonPhrase: Too Many Requests,
15+
Headers: [
16+
{
17+
Retry-After: [
18+
Sat, 01 Jan 2000 00:01:00 GMT
19+
]
20+
}
21+
],
22+
TrailingHeaders: [],
23+
IsSuccessStatusCode: false
24+
}
25+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
Version: 1.1,
4+
Content: {
5+
Headers: [
6+
{
7+
Content-Type: [
8+
text/plain
9+
]
10+
},
11+
{
12+
Content-MD5: [
13+
ZajifYh5KDgxtmS9i38K1A==
14+
]
15+
},
16+
{
17+
Content-Length: [
18+
13
19+
]
20+
}
21+
]
22+
},
23+
StatusCode: OK,
24+
ReasonPhrase: OK,
25+
Headers: [],
26+
TrailingHeaders: [],
27+
IsSuccessStatusCode: true
28+
},
29+
{
30+
Version: 1.1,
31+
Content: {
32+
Headers: [
33+
{
34+
Content-Length: [
35+
0
36+
]
37+
}
38+
]
39+
},
40+
StatusCode: TooManyRequests,
41+
ReasonPhrase: Too Many Requests,
42+
Headers: [
43+
{
44+
Retry-After: [
45+
Sat, 01 Jan 2000 00:01:00 GMT
46+
]
47+
}
48+
],
49+
TrailingHeaders: [],
50+
IsSuccessStatusCode: false
51+
}
52+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
[
2+
{
3+
Version: 1.1,
4+
Content: {
5+
Headers: [
6+
{
7+
Content-Type: [
8+
text/plain
9+
]
10+
},
11+
{
12+
Content-MD5: [
13+
ZajifYh5KDgxtmS9i38K1A==
14+
]
15+
},
16+
{
17+
Content-Length: [
18+
13
19+
]
20+
}
21+
]
22+
},
23+
StatusCode: OK,
24+
ReasonPhrase: OK,
25+
Headers: [],
26+
TrailingHeaders: [],
27+
IsSuccessStatusCode: true
28+
},
29+
{
30+
Version: 1.1,
31+
Content: {
32+
Headers: [
33+
{
34+
Content-Type: [
35+
text/plain
36+
]
37+
},
38+
{
39+
Content-MD5: [
40+
ZajifYh5KDgxtmS9i38K1A==
41+
]
42+
},
43+
{
44+
Content-Length: [
45+
13
46+
]
47+
}
48+
]
49+
},
50+
StatusCode: OK,
51+
ReasonPhrase: OK,
52+
Headers: [],
53+
TrailingHeaders: [],
54+
IsSuccessStatusCode: true
55+
},
56+
{
57+
Version: 1.1,
58+
Content: {
59+
Headers: [
60+
{
61+
Content-Length: [
62+
0
63+
]
64+
}
65+
]
66+
},
67+
StatusCode: TooManyRequests,
68+
ReasonPhrase: Too Many Requests,
69+
Headers: [
70+
{
71+
Retry-After: [
72+
Sat, 01 Jan 2000 00:01:00 GMT
73+
]
74+
}
75+
],
76+
TrailingHeaders: [],
77+
IsSuccessStatusCode: false
78+
}
79+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
[
2+
{
3+
Version: 1.1,
4+
Content: {
5+
Headers: [
6+
{
7+
Content-Type: [
8+
text/plain
9+
]
10+
},
11+
{
12+
Content-MD5: [
13+
ZajifYh5KDgxtmS9i38K1A==
14+
]
15+
},
16+
{
17+
Content-Length: [
18+
13
19+
]
20+
}
21+
]
22+
},
23+
StatusCode: OK,
24+
ReasonPhrase: OK,
25+
Headers: [],
26+
TrailingHeaders: [],
27+
IsSuccessStatusCode: true
28+
},
29+
{
30+
Version: 1.1,
31+
Content: {
32+
Headers: [
33+
{
34+
Content-Length: [
35+
0
36+
]
37+
}
38+
]
39+
},
40+
StatusCode: TooManyRequests,
41+
ReasonPhrase: Too Many Requests,
42+
Headers: [
43+
{
44+
Retry-After: [
45+
Sat, 01 Jan 2000 00:01:00 GMT
46+
]
47+
}
48+
],
49+
TrailingHeaders: [],
50+
IsSuccessStatusCode: false
51+
},
52+
{
53+
Version: 1.1,
54+
Content: {
55+
Headers: [
56+
{
57+
Content-Length: [
58+
0
59+
]
60+
}
61+
]
62+
},
63+
StatusCode: TooManyRequests,
64+
ReasonPhrase: Too Many Requests,
65+
Headers: [
66+
{
67+
Retry-After: [
68+
Sat, 01 Jan 2000 00:01:00 GMT
69+
]
70+
}
71+
],
72+
TrailingHeaders: [],
73+
IsSuccessStatusCode: false
74+
},
75+
{
76+
Version: 1.1,
77+
Content: {
78+
Headers: [
79+
{
80+
Content-Length: [
81+
0
82+
]
83+
}
84+
]
85+
},
86+
StatusCode: TooManyRequests,
87+
ReasonPhrase: Too Many Requests,
88+
Headers: [
89+
{
90+
Retry-After: [
91+
Sat, 01 Jan 2000 00:01:00 GMT
92+
]
93+
}
94+
],
95+
TrailingHeaders: [],
96+
IsSuccessStatusCode: false
97+
},
98+
{
99+
Version: 1.1,
100+
Content: {
101+
Headers: [
102+
{
103+
Content-Length: [
104+
0
105+
]
106+
}
107+
]
108+
},
109+
StatusCode: TooManyRequests,
110+
ReasonPhrase: Too Many Requests,
111+
Headers: [
112+
{
113+
Retry-After: [
114+
Sat, 01 Jan 2000 00:01:00 GMT
115+
]
116+
}
117+
],
118+
TrailingHeaders: [],
119+
IsSuccessStatusCode: false
120+
}
121+
]

0 commit comments

Comments
 (0)