-
-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into stef-fluent
- Loading branch information
Showing
14 changed files
with
614 additions
and
311 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
# 1.5.49 (06 March 2024) | ||
- #1069 Extend TypeLoader [feature] | ||
- #1078 Upgrade ProtoBufJsonConverter to fix issue with dot(s) in package name [bug] | ||
- #1077 ProtoBufMatcher not working when proto package name contains dots [bug] | ||
# 1.5.51 (20 March 2024) | ||
- #1085 Fix FluentAssertions (actual body is not displayed in error message) [bug] | ||
- #1084 FluentAssertions - Actual body is not displayed in error message when using Json Body [bug] | ||
|
||
The full release notes can be found here: https://github.com/WireMock-Net/WireMock.Net/blob/master/CHANGELOG.md |
60 changes: 60 additions & 0 deletions
60
src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.AtUrl.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
#pragma warning disable CS1591 | ||
using System; | ||
|
||
// ReSharper disable once CheckNamespace | ||
namespace WireMock.FluentAssertions; | ||
|
||
public partial class WireMockAssertions | ||
{ | ||
[CustomAssertion] | ||
public AndWhichConstraint<WireMockAssertions, string> AtAbsoluteUrl(string absoluteUrl, string because = "", params object[] becauseArgs) | ||
{ | ||
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.AbsoluteUrl, absoluteUrl, StringComparison.OrdinalIgnoreCase)); | ||
|
||
Execute.Assertion | ||
.BecauseOf(because, becauseArgs) | ||
.Given(() => RequestMessages) | ||
.ForCondition(requests => CallsCount == 0 || requests.Any()) | ||
.FailWith( | ||
"Expected {context:wiremockserver} to have been called at address matching the absolute url {0}{reason}, but no calls were made.", | ||
absoluteUrl | ||
) | ||
.Then | ||
.ForCondition(condition) | ||
.FailWith( | ||
"Expected {context:wiremockserver} to have been called at address matching the absolute url {0}{reason}, but didn't find it among the calls to {1}.", | ||
_ => absoluteUrl, | ||
requests => requests.Select(request => request.AbsoluteUrl) | ||
); | ||
|
||
FilterRequestMessages(filter); | ||
|
||
return new AndWhichConstraint<WireMockAssertions, string>(this, absoluteUrl); | ||
} | ||
|
||
[CustomAssertion] | ||
public AndWhichConstraint<WireMockAssertions, string> AtUrl(string url, string because = "", params object[] becauseArgs) | ||
{ | ||
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.Url, url, StringComparison.OrdinalIgnoreCase)); | ||
|
||
Execute.Assertion | ||
.BecauseOf(because, becauseArgs) | ||
.Given(() => RequestMessages) | ||
.ForCondition(requests => CallsCount == 0 || requests.Any()) | ||
.FailWith( | ||
"Expected {context:wiremockserver} to have been called at address matching the url {0}{reason}, but no calls were made.", | ||
url | ||
) | ||
.Then | ||
.ForCondition(condition) | ||
.FailWith( | ||
"Expected {context:wiremockserver} to have been called at address matching the url {0}{reason}, but didn't find it among the calls to {1}.", | ||
_ => url, | ||
requests => requests.Select(request => request.Url) | ||
); | ||
|
||
FilterRequestMessages(filter); | ||
|
||
return new AndWhichConstraint<WireMockAssertions, string>(this, url); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/WireMock.Net.FluentAssertions/Assertions/WireMockAssertions.FromClientIP.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma warning disable CS1591 | ||
using System; | ||
|
||
// ReSharper disable once CheckNamespace | ||
namespace WireMock.FluentAssertions; | ||
|
||
public partial class WireMockAssertions | ||
{ | ||
[CustomAssertion] | ||
public AndWhichConstraint<WireMockAssertions, string> FromClientIP(string clientIP, string because = "", params object[] becauseArgs) | ||
{ | ||
var (filter, condition) = BuildFilterAndCondition(request => string.Equals(request.ClientIP, clientIP, StringComparison.OrdinalIgnoreCase)); | ||
|
||
Execute.Assertion | ||
.BecauseOf(because, becauseArgs) | ||
.Given(() => RequestMessages) | ||
.ForCondition(requests => CallsCount == 0 || requests.Any()) | ||
.FailWith( | ||
"Expected {context:wiremockserver} to have been called from client IP {0}{reason}, but no calls were made.", | ||
clientIP | ||
) | ||
.Then | ||
.ForCondition(condition) | ||
.FailWith( | ||
"Expected {context:wiremockserver} to have been called from client IP {0}{reason}, but didn't find it among the calls from IP(s) {1}.", | ||
_ => clientIP, requests => requests.Select(request => request.ClientIP) | ||
); | ||
|
||
FilterRequestMessages(filter); | ||
|
||
return new AndWhichConstraint<WireMockAssertions, string>(this, clientIP); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.