Summary

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

Metrics

MethodCyclomatic complexity NPath complexity Sequence coverage Branch coverage
GetPatterns()0010
.ctor(...)0010
.ctor(...)0010
.ctor(...)0010
.ctor(...)0011

File(s)

C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\WildcardMatcher.cs

#LineLine coverage
 1using System.Linq;
 2using System.Text.RegularExpressions;
 3using JetBrains.Annotations;
 4
 5namespace WireMock.Matchers
 6{
 7    /// <summary>
 8    /// WildcardMatcher
 9    /// </summary>
 10    /// <seealso cref="RegexMatcher" />
 11    public class WildcardMatcher : RegexMatcher
 12    {
 13        private readonly string[] _patterns;
 14
 15        /// <summary>
 16        /// Initializes a new instance of the <see cref="WildcardMatcher"/> class.
 17        /// </summary>
 18        /// <param name="pattern">The pattern.</param>
 19        /// <param name="ignoreCase">IgnoreCase</param>
 3120        public WildcardMatcher([NotNull] string pattern, bool ignoreCase = false) : this(new[] { pattern }, ignoreCase)
 3121        {
 3122        }
 23
 24        /// <summary>
 25        /// Initializes a new instance of the <see cref="WildcardMatcher"/> class.
 26        /// </summary>
 27        /// <param name="matchBehaviour">The match behaviour.</param>
 28        /// <param name="pattern">The pattern.</param>
 29        /// <param name="ignoreCase">IgnoreCase</param>
 21930        public WildcardMatcher(MatchBehaviour matchBehaviour, [NotNull] string pattern, bool ignoreCase = false) : this(
 21931        {
 21932        }
 33
 34        /// <summary>
 35        /// Initializes a new instance of the <see cref="WildcardMatcher"/> class.
 36        /// </summary>
 37        /// <param name="patterns">The patterns.</param>
 38        /// <param name="ignoreCase">IgnoreCase</param>
 3139        public WildcardMatcher([NotNull] string[] patterns, bool ignoreCase = false) : this(MatchBehaviour.AcceptOnMatch
 3140        {
 3141        }
 42
 43        /// <summary>
 44        /// Initializes a new instance of the <see cref="WildcardMatcher"/> class.
 45        /// </summary>
 46        /// <param name="matchBehaviour">The match behaviour.</param>
 47        /// <param name="patterns">The patterns.</param>
 48        /// <param name="ignoreCase">IgnoreCase</param>
 51149        public WildcardMatcher(MatchBehaviour matchBehaviour, [NotNull] string[] patterns, bool ignoreCase = false) : ba
 25550        {
 25551            _patterns = patterns;
 25552        }
 53
 54        /// <inheritdoc cref="IStringMatcher.GetPatterns"/>
 55        public override string[] GetPatterns()
 356        {
 357            return _patterns;
 358        }
 59
 60        /// <inheritdoc cref="IMatcher.Name"/>
 261        public override string Name => "WildcardMatcher";
 62    }
 63}