Summary

Class:WireMock.Matchers.ExactMatcher
Assembly:WireMock.Net
File(s):C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\ExactMatcher.cs
Covered lines:14
Uncovered lines:0
Coverable lines:14
Total lines:44
Line coverage:100%

Metrics

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

File(s)

C:\Users\azureuser\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="IStringMatcher" />
 11    public class ExactMatcher : IStringMatcher
 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>
 1519        public ExactMatcher([NotNull] params string[] values)
 1520        {
 1521            Check.HasNoNulls(values, nameof(values));
 22
 1523            _values = values;
 1524        }
 25
 26        /// <inheritdoc cref="IStringMatcher.IsMatch"/>
 27        public double IsMatch(string input)
 528        {
 1629            return MatchScores.ToScore(_values.Select(value => value.Equals(input)));
 530        }
 31
 32        /// <inheritdoc cref="IStringMatcher.GetPatterns"/>
 33        public string[] GetPatterns()
 334        {
 335            return _values;
 336        }
 37
 38        /// <inheritdoc cref="IMatcher.GetName"/>
 39        public string GetName()
 140        {
 141            return "ExactMatcher";
 142        }
 43    }
 44}