# WireMock.Matchers.Request.RequestMessageUrlMatcher - Coverage Report

# Summary

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

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
.ctor(...) | 2 | 0 | 100 | 100
.ctor(...) | 1 | 0 | 100 | 100
.ctor(...) | 1 | 0 | 100 | 100
GetMatchingScore(...) | 1 | 0 | 100 | 100
IsMatch(...) | 4 | 4 | 88.89 | 80

# File(s)

## C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMessageUrlMatcher.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 url matcher.`
|  | `11` |  | `/// </summary>`
|  | `12` |  | `public class RequestMessageUrlMatcher : IRequestMatcher`
|  | `13` |  | `{`
|  | `14` |  | `/// <summary>`
|  | `15` |  | `/// The matchers.`
|  | `16` |  | `/// </summary>`
| 5 | `17` |  | `public IReadOnlyList<IStringMatcher> Matchers { get; }`
|  | `18` |  | ``
|  | `19` |  | `/// <summary>`
|  | `20` |  | `/// The url functions.`
|  | `21` |  | `/// </summary>`
| 2 | `22` |  | `public Func<string, bool>[] Funcs { get; }`
|  | `23` |  | ``
|  | `24` |  | `/// <summary>`
|  | `25` |  | `/// Initializes a new instance of the <see cref="RequestMessageUrlMatcher"/> class.`
|  | `26` |  | `/// </summary>`
|  | `27` |  | `/// <param name="urls">The urls.</param>`
| 2 | `28` |  | `public RequestMessageUrlMatcher([NotNull] params string[] urls) : this(urls.Select(url => new WildcardMatcher(ur`
| 1 | `29` |  | `{`
| 1 | `30` |  | `}`
|  | `31` |  | ``
|  | `32` |  | `/// <summary>`
|  | `33` |  | `/// Initializes a new instance of the <see cref="RequestMessageUrlMatcher"/> class.`
|  | `34` |  | `/// </summary>`
|  | `35` |  | `/// <param name="matchers">The matchers.</param>`
| 2 | `36` |  | `public RequestMessageUrlMatcher([NotNull] params IStringMatcher[] matchers)`
| 2 | `37` |  | `{`
| 2 | `38` |  | `Check.NotNull(matchers, nameof(matchers));`
| 2 | `39` |  | `Matchers = matchers;`
| 2 | `40` |  | `}`
|  | `41` |  | ``
|  | `42` |  | `/// <summary>`
|  | `43` |  | `/// Initializes a new instance of the <see cref="RequestMessageUrlMatcher"/> class.`
|  | `44` |  | `/// </summary>`
|  | `45` |  | `/// <param name="funcs">The url functions.</param>`
| 1 | `46` |  | `public RequestMessageUrlMatcher([NotNull] params Func<string, bool>[] funcs)`
| 1 | `47` |  | `{`
| 1 | `48` |  | `Check.NotNull(funcs, nameof(funcs));`
| 1 | `49` |  | `Funcs = funcs;`
| 1 | `50` |  | `}`
|  | `51` |  | ``
|  | `52` |  | `/// <inheritdoc cref="IRequestMatcher.GetMatchingScore"/>`
|  | `53` |  | `public double GetMatchingScore(RequestMessage requestMessage, RequestMatchResult requestMatchResult)`
| 3 | `54` |  | `{`
| 3 | `55` |  | `double score = IsMatch(requestMessage);`
| 3 | `56` |  | `return requestMatchResult.AddScore(GetType(), score);`
| 3 | `57` |  | `}`
|  | `58` |  | ``
|  | `59` |  | `private double IsMatch(RequestMessage requestMessage)`
| 3 | `60` |  | `{`
| 3 | `61` |  | `if (Matchers != null)`
| 2 | `62` |  | `{`
| 4 | `63` |  | `return Matchers.Max(matcher => matcher.IsMatch(requestMessage.Url));`
|  | `64` |  | `}`
|  | `65` |  | ``
| 1 | `66` |  | `if (Funcs != null)`
| 1 | `67` |  | `{`
| 2 | `68` |  | `return MatchScores.ToScore(requestMessage.Url != null && Funcs.Any(func => func(requestMessage.Url)));`
|  | `69` |  | `}`
|  | `70` |  | ``
| 0 | `71` |  | `return MatchScores.Mismatch;`
| 3 | `72` |  | `}`
|  | `73` |  | `}`
|  | `74` |  | `}`

# Methods/Properties

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