mirror of
https://github.com/wiremock/WireMock.Net.git
synced 2026-02-23 02:34:55 +01:00
* jsonpath in response * Fix tests * Support also BodyAsJson * Fix Sonar Issue * Add example (zubinix2) * Fix batch file * Solve CodeFactor issues * netcoreapp2.0;netcoreapp2.1 * 1.0.4.8
27 lines
976 B
C#
27 lines
976 B
C#
namespace WireMock.Matchers
|
|
{
|
|
internal static class MatchBehaviourHelper
|
|
{
|
|
/// <summary>
|
|
/// Converts the specified match behaviour and match value to a new match value.
|
|
///
|
|
/// if AcceptOnMatch --> return match (default)
|
|
/// if RejectOnMatch and match = 0.0 --> return 1.0
|
|
/// if RejectOnMatch and match = 0.? --> return 0.0
|
|
/// if RejectOnMatch and match = 1.0 --> return 0.0
|
|
/// </summary>
|
|
///
|
|
/// <param name="matchBehaviour">The match behaviour.</param>
|
|
/// <param name="match">The match.</param>
|
|
/// <returns>match value</returns>
|
|
internal static double Convert(MatchBehaviour matchBehaviour, double match)
|
|
{
|
|
if (matchBehaviour == MatchBehaviour.AcceptOnMatch)
|
|
{
|
|
return match;
|
|
}
|
|
|
|
return match <= MatchScores.Tolerance ? MatchScores.Perfect : MatchScores.Mismatch;
|
|
}
|
|
}
|
|
} |