# Summary

Class: | WireMock.Matchers.Request.RequestMessagePathMatcher
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMessagePathMatcher.cs
Covered lines: | 27
Uncovered lines: | 1
Coverable lines: | 28
Total lines: | 77
Line coverage: | 96.4%
Branch coverage: | 66.6%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
GetMatchingScore(...) | 0 | 0 | 1 | 0
IsMatch(...) | 0 | 0 | 0.889 | 0.667
.ctor(...) | 0 | 0 | 1 | 0
.ctor(...) | 0 | 0 | 1 | 0
.ctor(...) | 0 | 0 | 1 | 0

# File(s)

## C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMessagePathMatcher.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Collections.Generic;`
|  | `3` |  | `using System.Linq;`
|  | `4` |  | `using JetBrains.Annotations;`
|  | `5` |  | `using WireMock.Validation;`
|  | `6` |  | ``
|  | `7` |  | `namespace WireMock.Matchers.Request`
|  | `8` |  | `{`
|  | `9` |  | `/// <summary>`
|  | `10` |  | `/// The request path matcher.`
|  | `11` |  | `/// </summary>`
|  | `12` |  | `public class RequestMessagePathMatcher : IRequestMatcher`
|  | `13` |  | `{`
|  | `14` |  | `/// <summary>`
|  | `15` |  | `/// The matchers`
|  | `16` |  | `/// </summary>`
| 625 | `17` |  | `public IReadOnlyList<IStringMatcher> Matchers { get; }`
|  | `18` |  | ``
|  | `19` |  | `/// <summary>`
|  | `20` |  | `/// The path functions`
|  | `21` |  | `/// </summary>`
| 2 | `22` |  | `public Func<string, bool>[] Funcs { get; }`
|  | `23` |  | ``
|  | `24` |  | `/// <summary>`
|  | `25` |  | `/// Initializes a new instance of the <see cref="RequestMessagePathMatcher"/> class.`
|  | `26` |  | `/// </summary>`
|  | `27` |  | `/// <param name="matchBehaviour">The match behaviour.</param>`
|  | `28` |  | `/// <param name="paths">The paths.</param>`
| 421 | `29` |  | `public RequestMessagePathMatcher(MatchBehaviour matchBehaviour, [NotNull] params string[] paths) : this(paths.Se`
| 210 | `30` |  | `{`
| 210 | `31` |  | `}`
|  | `32` |  | ``
|  | `33` |  | `/// <summary>`
|  | `34` |  | `/// Initializes a new instance of the <see cref="RequestMessagePathMatcher"/> class.`
|  | `35` |  | `/// </summary>`
|  | `36` |  | `/// <param name="matchers">The matchers.</param>`
| 277 | `37` |  | `public RequestMessagePathMatcher([NotNull] params IStringMatcher[] matchers)`
| 277 | `38` |  | `{`
| 277 | `39` |  | `Check.NotNull(matchers, nameof(matchers));`
|  | `40` |  | ``
| 277 | `41` |  | `Matchers = matchers;`
| 277 | `42` |  | `}`
|  | `43` |  | ``
|  | `44` |  | `/// <summary>`
|  | `45` |  | `/// Initializes a new instance of the <see cref="RequestMessagePathMatcher"/> class.`
|  | `46` |  | `/// </summary>`
|  | `47` |  | `/// <param name="funcs">The path functions.</param>`
| 1 | `48` |  | `public RequestMessagePathMatcher([NotNull] params Func<string, bool>[] funcs)`
| 1 | `49` |  | `{`
| 1 | `50` |  | `Check.NotNull(funcs, nameof(funcs));`
|  | `51` |  | ``
| 1 | `52` |  | `Funcs = funcs;`
| 1 | `53` |  | `}`
|  | `54` |  | ``
|  | `55` |  | `/// <inheritdoc cref="IRequestMatcher.GetMatchingScore"/>`
|  | `56` |  | `public double GetMatchingScore(RequestMessage requestMessage, RequestMatchResult requestMatchResult)`
| 312 | `57` |  | `{`
| 312 | `58` |  | `double score = IsMatch(requestMessage);`
| 312 | `59` |  | `return requestMatchResult.AddScore(GetType(), score);`
| 312 | `60` |  | `}`
|  | `61` |  | ``
|  | `62` |  | `private double IsMatch(RequestMessage requestMessage)`
| 312 | `63` |  | `{`
| 312 | `64` |  | `if (Matchers != null)`
| 311 | `65` |  | `{`
| 624 | `66` |  | `return Matchers.Max(m => m.IsMatch(requestMessage.Path));`
|  | `67` |  | `}`
|  | `68` |  | ``
| 1 | `69` |  | `if (Funcs != null)`
| 1 | `70` |  | `{`
| 2 | `71` |  | `return MatchScores.ToScore(requestMessage.Path != null && Funcs.Any(func => func(requestMessage.Path)));`
|  | `72` |  | `}`
|  | `73` |  | ``
| 0 | `74` |  | `return MatchScores.Mismatch;`
| 312 | `75` |  | `}`
|  | `76` |  | `}`
|  | `77` |  | `}`

# Methods/Properties

Matchers()
Funcs()
.ctor(WireMock.Matchers.MatchBehaviour,System.String[])
.ctor(WireMock.Matchers.IStringMatcher[])
.ctor(System.Func`2<System.String,System.Boolean>[])
GetMatchingScore(WireMock.RequestMessage,WireMock.Matchers.Request.RequestMatchResult)
IsMatch(WireMock.RequestMessage)