Summary

Class:WireMock.Matchers.MatchBehaviourHelper
Assembly:WireMock.Net
File(s):C:\Users\StefHeyenrath\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\MatchBehaviourHelper.cs
Covered lines:6
Uncovered lines:0
Coverable lines:6
Total lines:27
Line coverage:100%
Branch coverage:100%

Metrics

MethodCyclomatic complexity NPath complexity Sequence coverage Branch coverage
Convert(...)0011

File(s)

C:\Users\StefHeyenrath\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\MatchBehaviourHelper.cs

#LineLine coverage
 1namespace WireMock.Matchers
 2{
 3    internal static class MatchBehaviourHelper
 4    {
 5        /// <summary>
 6        /// Converts the specified match behaviour and match value to a new match value.
 7        ///
 8        /// if AcceptOnMatch --> return match (default)
 9        /// if RejectOnMatch and match = 0.0 --> return 1.0
 10        /// if RejectOnMatch and match = 0.? --> return 0.0
 11        /// if RejectOnMatch and match = 1.0 --> return 0.0
 12        /// </summary>
 13        ///
 14        /// <param name="matchBehaviour">The match behaviour.</param>
 15        /// <param name="match">The match.</param>
 16        /// <returns>match value</returns>
 17        internal static double Convert(MatchBehaviour matchBehaviour, double match)
 75818        {
 75819            if (matchBehaviour == MatchBehaviour.AcceptOnMatch)
 74020            {
 74021                return match;
 22            }
 23
 1824            return match <= MatchScores.Tolerance ? MatchScores.Perfect : MatchScores.Mismatch;
 75825        }
 26    }
 27}