Skip to content

Commit ed45286

Browse files
committed
Adjust tests
1 parent c78e38f commit ed45286

6 files changed

Lines changed: 24 additions & 24 deletions

Tests/Mockolate.Tests/Web/HttpClientExtensionsTests.Setup.PatchTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public async Task StringUri_ShouldVerifyHttpMethod(string method, bool expectSuc
4343
{
4444
HttpClient httpClient = Mock.Create<HttpClient>();
4545
httpClient.SetupMock.Method
46-
.PatchAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>())
46+
.PatchAsync(It.Matches("*aweXpect.com*"))
4747
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
4848

4949
HttpResponseMessage result = await httpClient.SendAsync(
@@ -63,7 +63,7 @@ public async Task StringUri_ShouldVerifyUriString(string pattern, bool expectSuc
6363
{
6464
HttpClient httpClient = Mock.Create<HttpClient>();
6565
httpClient.SetupMock.Method
66-
.PatchAsync(It.Matches(pattern), It.IsAny<HttpContent>())
66+
.PatchAsync(It.Matches(pattern))
6767
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
6868

6969
HttpResponseMessage result = await httpClient.PatchAsync("https://www.aweXpect.com",
@@ -103,7 +103,7 @@ public async Task StringUri_WithoutMockedHttpMessageHandler_ShouldThrowMockExcep
103103
void Act()
104104
{
105105
httpClient.SetupMock.Method
106-
.PatchAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>())
106+
.PatchAsync(It.Matches("*aweXpect.com*"))
107107
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
108108
}
109109

@@ -141,7 +141,7 @@ public async Task Uri_ShouldVerifyHttpMethod(string method, bool expectSuccess)
141141
{
142142
HttpClient httpClient = Mock.Create<HttpClient>();
143143
httpClient.SetupMock.Method
144-
.PatchAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>())
144+
.PatchAsync(It.IsUri("*aweXpect.com*"))
145145
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
146146

147147
HttpResponseMessage result = await httpClient.SendAsync(
@@ -161,7 +161,7 @@ public async Task Uri_ShouldVerifyUri(string pattern, bool expectSuccess)
161161
{
162162
HttpClient httpClient = Mock.Create<HttpClient>();
163163
httpClient.SetupMock.Method
164-
.PatchAsync(It.IsUri(pattern), It.IsAny<HttpContent>())
164+
.PatchAsync(It.IsUri(pattern))
165165
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
166166

167167
HttpResponseMessage result = await httpClient.PatchAsync("https://www.aweXpect.com",
@@ -201,7 +201,7 @@ public async Task Uri_WithoutMockedHttpMessageHandler_ShouldThrowMockException()
201201
void Act()
202202
{
203203
httpClient.SetupMock.Method
204-
.PatchAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>())
204+
.PatchAsync(It.IsUri("*aweXpect.com*"))
205205
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
206206
}
207207

Tests/Mockolate.Tests/Web/HttpClientExtensionsTests.Setup.PostTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task StringUri_ShouldVerifyHttpMethod(string method, bool expectSuc
4141
{
4242
HttpClient httpClient = Mock.Create<HttpClient>();
4343
httpClient.SetupMock.Method
44-
.PostAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>())
44+
.PostAsync(It.Matches("*aweXpect.com*"))
4545
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
4646

4747
HttpResponseMessage result = await httpClient.SendAsync(
@@ -61,7 +61,7 @@ public async Task StringUri_ShouldVerifyUriString(string pattern, bool expectSuc
6161
{
6262
HttpClient httpClient = Mock.Create<HttpClient>();
6363
httpClient.SetupMock.Method
64-
.PostAsync(It.Matches(pattern), It.IsAny<HttpContent>())
64+
.PostAsync(It.Matches(pattern))
6565
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
6666

6767
HttpResponseMessage result = await httpClient.PostAsync("https://www.aweXpect.com",
@@ -101,7 +101,7 @@ public async Task StringUri_WithoutMockedHttpMessageHandler_ShouldThrowMockExcep
101101
void Act()
102102
{
103103
httpClient.SetupMock.Method
104-
.PostAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>())
104+
.PostAsync(It.Matches("*aweXpect.com*"))
105105
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
106106
}
107107

@@ -138,7 +138,7 @@ public async Task Uri_ShouldVerifyHttpMethod(string method, bool expectSuccess)
138138
{
139139
HttpClient httpClient = Mock.Create<HttpClient>();
140140
httpClient.SetupMock.Method
141-
.PostAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>())
141+
.PostAsync(It.IsUri("*aweXpect.com*"))
142142
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
143143

144144
HttpResponseMessage result = await httpClient.SendAsync(
@@ -158,7 +158,7 @@ public async Task Uri_ShouldVerifyUri(string pattern, bool expectSuccess)
158158
{
159159
HttpClient httpClient = Mock.Create<HttpClient>();
160160
httpClient.SetupMock.Method
161-
.PostAsync(It.IsUri(pattern), It.IsAny<HttpContent>())
161+
.PostAsync(It.IsUri(pattern))
162162
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
163163

164164
HttpResponseMessage result = await httpClient.PostAsync("https://www.aweXpect.com",
@@ -198,7 +198,7 @@ public async Task Uri_WithoutMockedHttpMessageHandler_ShouldThrowMockException()
198198
void Act()
199199
{
200200
httpClient.SetupMock.Method
201-
.PostAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>())
201+
.PostAsync(It.IsUri("*aweXpect.com*"))
202202
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
203203
}
204204

Tests/Mockolate.Tests/Web/HttpClientExtensionsTests.Setup.PutTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public async Task StringUri_ShouldVerifyHttpMethod(string method, bool expectSuc
4141
{
4242
HttpClient httpClient = Mock.Create<HttpClient>();
4343
httpClient.SetupMock.Method
44-
.PutAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>())
44+
.PutAsync(It.Matches("*aweXpect.com*"))
4545
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
4646

4747
HttpResponseMessage result = await httpClient.SendAsync(
@@ -61,7 +61,7 @@ public async Task StringUri_ShouldVerifyUriString(string pattern, bool expectSuc
6161
{
6262
HttpClient httpClient = Mock.Create<HttpClient>();
6363
httpClient.SetupMock.Method
64-
.PutAsync(It.Matches(pattern), It.IsAny<HttpContent>())
64+
.PutAsync(It.Matches(pattern))
6565
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
6666

6767
HttpResponseMessage result = await httpClient.PutAsync("https://www.aweXpect.com",
@@ -101,7 +101,7 @@ public async Task StringUri_WithoutMockedHttpMessageHandler_ShouldThrowMockExcep
101101
void Act()
102102
{
103103
httpClient.SetupMock.Method
104-
.PutAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>())
104+
.PutAsync(It.Matches("*aweXpect.com*"))
105105
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
106106
}
107107

@@ -138,7 +138,7 @@ public async Task Uri_ShouldVerifyHttpMethod(string method, bool expectSuccess)
138138
{
139139
HttpClient httpClient = Mock.Create<HttpClient>();
140140
httpClient.SetupMock.Method
141-
.PutAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>())
141+
.PutAsync(It.IsUri("*aweXpect.com*"))
142142
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
143143

144144
HttpResponseMessage result = await httpClient.SendAsync(
@@ -158,7 +158,7 @@ public async Task Uri_ShouldVerifyUri(string pattern, bool expectSuccess)
158158
{
159159
HttpClient httpClient = Mock.Create<HttpClient>();
160160
httpClient.SetupMock.Method
161-
.PutAsync(It.IsUri(pattern), It.IsAny<HttpContent>())
161+
.PutAsync(It.IsUri(pattern))
162162
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
163163

164164
HttpResponseMessage result = await httpClient.PutAsync("https://www.aweXpect.com",
@@ -198,7 +198,7 @@ public async Task Uri_WithoutMockedHttpMessageHandler_ShouldThrowMockException()
198198
void Act()
199199
{
200200
httpClient.SetupMock.Method
201-
.PutAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>())
201+
.PutAsync(It.IsUri("*aweXpect.com*"))
202202
.ReturnsAsync(new HttpResponseMessage(HttpStatusCode.OK));
203203
}
204204

Tests/Mockolate.Tests/Web/HttpClientExtensionsTests.Verify.PatchTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public async Task StringUri_WithoutMockedHttpMessageHandler_ShouldThrowMockExcep
9494
void Act()
9595
{
9696
httpClient.VerifyMock.Invoked
97-
.PatchAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>()).Never();
97+
.PatchAsync(It.Matches("*aweXpect.com*")).Never();
9898
}
9999

100100
await That(Act).Throws<MockException>()
@@ -181,7 +181,7 @@ public async Task Uri_WithoutMockedHttpMessageHandler_ShouldThrowMockException()
181181
void Act()
182182
{
183183
httpClient.VerifyMock.Invoked
184-
.PatchAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>()).Never();
184+
.PatchAsync(It.IsUri("*aweXpect.com*")).Never();
185185
}
186186

187187
await That(Act).Throws<MockException>()

Tests/Mockolate.Tests/Web/HttpClientExtensionsTests.Verify.PostTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public async Task StringUri_WithoutMockedHttpMessageHandler_ShouldThrowMockExcep
9292
void Act()
9393
{
9494
httpClient.VerifyMock.Invoked
95-
.PostAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>()).Never();
95+
.PostAsync(It.Matches("*aweXpect.com*")).Never();
9696
}
9797

9898
await That(Act).Throws<MockException>()
@@ -178,7 +178,7 @@ public async Task Uri_WithoutMockedHttpMessageHandler_ShouldThrowMockException()
178178
void Act()
179179
{
180180
httpClient.VerifyMock.Invoked
181-
.PostAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>()).Never();
181+
.PostAsync(It.IsUri("*aweXpect.com*")).Never();
182182
}
183183

184184
await That(Act).Throws<MockException>()

Tests/Mockolate.Tests/Web/HttpClientExtensionsTests.Verify.PutTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public async Task StringUri_WithoutMockedHttpMessageHandler_ShouldThrowMockExcep
9292
void Act()
9393
{
9494
httpClient.VerifyMock.Invoked
95-
.PutAsync(It.Matches("*aweXpect.com*"), It.IsAny<HttpContent>()).Never();
95+
.PutAsync(It.Matches("*aweXpect.com*")).Never();
9696
}
9797

9898
await That(Act).Throws<MockException>()
@@ -178,7 +178,7 @@ public async Task Uri_WithoutMockedHttpMessageHandler_ShouldThrowMockException()
178178
void Act()
179179
{
180180
httpClient.VerifyMock.Invoked
181-
.PutAsync(It.IsUri("*aweXpect.com*"), It.IsAny<HttpContent>()).Never();
181+
.PutAsync(It.IsUri("*aweXpect.com*")).Never();
182182
}
183183

184184
await That(Act).Throws<MockException>()

0 commit comments

Comments
 (0)