Summary

Class:WireMock.Matchers.ExactMatcher
Assembly:WireMock.Net
File(s):C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\ExactMatcher.cs
Covered lines:8
Uncovered lines:6
Coverable lines:14
Total lines:54
Line coverage:57.1%

Metrics

MethodCyclomatic complexity  NPath complexity  Sequence coverage  Branch coverage  
.ctor(...)10100100
IsMatch(...)10100100
GetPatterns()1000
GetName()1000

File(s)

C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\ExactMatcher.cs

#LineLine coverage
 1using System.Linq;
 2using JetBrains.Annotations;
 3using WireMock.Validation;
 4
 5namespace WireMock.Matchers
 6{
 7    /// <summary>
 8    /// ExactMatcher
 9    /// </summary>
 10    /// <seealso cref="IMatcher" />
 11    public class ExactMatcher : IMatcher
 12    {
 13        private readonly string[] _values;
 14
 15        /// <summary>
 16        /// Initializes a new instance of the <see cref="ExactMatcher"/> class.
 17        /// </summary>
 18        /// <param name="values">The values.</param>
 719        public ExactMatcher([NotNull] params string[] values)
 720        {
 721            Check.NotNull(values, nameof(values));
 22
 723            _values = values;
 724        }
 25
 26        /// <summary>
 27        /// Determines whether the specified input is match.
 28        /// </summary>
 29        /// <param name="input">The input.</param>
 30        /// <returns>A value between 0.0 - 1.0 of the similarity.</returns>
 31        public double IsMatch(string input)
 332        {
 733            return MatchScores.ToScore(_values.Select(value => value.Equals(input)));
 334        }
 35
 36        /// <summary>
 37        /// Gets the value.
 38        /// </summary>
 39        /// <returns>Patterns</returns>
 40        public string[] GetPatterns()
 041        {
 042            return _values;
 043        }
 44
 45        /// <summary>
 46        /// Gets the name.
 47        /// </summary>
 48        /// <returns>Name</returns>
 49        public string GetName()
 050        {
 051            return "ExactMatcher";
 052        }
 53    }
 54}