Summary

Class:WireMock.Matchers.WildcardMatcher
Assembly:WireMock.Net
File(s):C:\Users\StefHeyenrath\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\StefHeyenrath\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>
 3020        public WildcardMatcher([NotNull] string pattern, bool ignoreCase = false) : this(new[] { pattern }, ignoreCase)
 3021        {
 3022        }
 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>
 26430        public WildcardMatcher(MatchBehaviour matchBehaviour, [NotNull] string pattern, bool ignoreCase = false) : this(
 26531        {
 26532        }
 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>
 3039        public WildcardMatcher([NotNull] string[] patterns, bool ignoreCase = false) : this(MatchBehaviour.AcceptOnMatch
 3040        {
 3041        }
 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>
 60249        public WildcardMatcher(MatchBehaviour matchBehaviour, [NotNull] string[] patterns, bool ignoreCase = false) : ba
 30050        {
 30051            _patterns = patterns;
 30052        }
 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}