# Summary

Class: | WireMock.Matchers.Request.RequestMessageParamMatcher
Assembly: | WireMock.Net
File(s): | C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMessageParamMatcher.cs
Covered lines: | 26
Uncovered lines: | 0
Coverable lines: | 26
Total lines: | 85
Line coverage: | 100%
Branch coverage: | 100%

# Metrics

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

# File(s)

## C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMessageParamMatcher.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Collections.Generic;`
|  | `3` |  | `using System.Linq;`
|  | `4` |  | `using JetBrains.Annotations;`
|  | `5` |  | `using WireMock.Util;`
|  | `6` |  | `using WireMock.Validation;`
|  | `7` |  | ``
|  | `8` |  | `namespace WireMock.Matchers.Request`
|  | `9` |  | `{`
|  | `10` |  | `/// <summary>`
|  | `11` |  | `/// The request parameters matcher.`
|  | `12` |  | `/// </summary>`
|  | `13` |  | `public class RequestMessageParamMatcher : IRequestMatcher`
|  | `14` |  | `{`
|  | `15` |  | `/// <summary>`
|  | `16` |  | `/// The funcs`
|  | `17` |  | `/// </summary>`
| 5 | `18` |  | `public Func<IDictionary<string, WireMockList<string>>, bool>[] Funcs { get; }`
|  | `19` |  | ``
|  | `20` |  | `/// <summary>`
|  | `21` |  | `/// The key`
|  | `22` |  | `/// </summary>`
| 3 | `23` |  | `public string Key { get; }`
|  | `24` |  | ``
|  | `25` |  | `/// <summary>`
|  | `26` |  | `/// The values`
|  | `27` |  | `/// </summary>`
| 5 | `28` |  | `public IEnumerable<string> Values { get; }`
|  | `29` |  | ``
|  | `30` |  | `/// <summary>`
|  | `31` |  | `/// Initializes a new instance of the <see cref="RequestMessageParamMatcher"/> class.`
|  | `32` |  | `/// </summary>`
|  | `33` |  | `/// <param name="key">`
|  | `34` |  | `/// The key.`
|  | `35` |  | `/// </param>`
|  | `36` |  | `/// <param name="values">`
|  | `37` |  | `/// The values.`
|  | `38` |  | `/// </param>`
| 3 | `39` |  | `public RequestMessageParamMatcher([NotNull] string key, [CanBeNull] IEnumerable<string> values)`
| 3 | `40` |  | `{`
| 3 | `41` |  | `Check.NotNull(key, nameof(key));`
|  | `42` |  | ``
| 3 | `43` |  | `Key = key;`
| 3 | `44` |  | `Values = values;`
| 3 | `45` |  | `}`
|  | `46` |  | ``
|  | `47` |  | `/// <summary>`
|  | `48` |  | `/// Initializes a new instance of the <see cref="RequestMessageParamMatcher"/> class.`
|  | `49` |  | `/// </summary>`
|  | `50` |  | `/// <param name="funcs">The funcs.</param>`
| 1 | `51` |  | `public RequestMessageParamMatcher([NotNull] params Func<IDictionary<string, WireMockList<string>>, bool>[] funcs`
| 1 | `52` |  | `{`
| 1 | `53` |  | `Check.NotNull(funcs, nameof(funcs));`
| 1 | `54` |  | `Funcs = funcs;`
| 1 | `55` |  | `}`
|  | `56` |  | ``
|  | `57` |  | `/// <summary>`
|  | `58` |  | `/// Determines whether the specified RequestMessage is match.`
|  | `59` |  | `/// </summary>`
|  | `60` |  | `/// <param name="requestMessage">The RequestMessage.</param>`
|  | `61` |  | `/// <param name="requestMatchResult">The RequestMatchResult.</param>`
|  | `62` |  | `/// <returns>`
|  | `63` |  | `/// A value between 0.0 - 1.0 of the similarity.`
|  | `64` |  | `/// </returns>`
|  | `65` |  | `public double GetMatchingScore(RequestMessage requestMessage, RequestMatchResult requestMatchResult)`
| 4 | `66` |  | `{`
| 4 | `67` |  | `double score = IsMatch(requestMessage);`
| 4 | `68` |  | `requestMatchResult.TotalScore += score;`
|  | `69` |  | ``
| 4 | `70` |  | `requestMatchResult.TotalNumber++;`
|  | `71` |  | ``
| 4 | `72` |  | `return score;`
| 4 | `73` |  | `}`
|  | `74` |  | ``
|  | `75` |  | `private double IsMatch(RequestMessage requestMessage)`
| 4 | `76` |  | `{`
| 4 | `77` |  | `if (Funcs != null)`
| 2 | `78` |  | `return MatchScores.ToScore(requestMessage.Query != null && Funcs.Any(f => f(requestMessage.Query)));`
|  | `79` |  | ``
| 3 | `80` |  | `List<string> values = requestMessage.GetParameter(Key);`
|  | `81` |  | ``
| 3 | `82` |  | `return MatchScores.ToScore(values?.Intersect(Values).Count() == Values.Count());`
| 4 | `83` |  | `}`
|  | `84` |  | `}`
|  | `85` |  | `}`

# Methods/Properties

Funcs()
Key()
Values()
.ctor(System.String,System.Collections.Generic.IEnumerable`1<System.String>)
.ctor(System.Func`2<System.Collections.Generic.IDictionary`2<System.String,WireMock.Util.WireMockList`1<System.String>>,System.Boolean>[])
GetMatchingScore(WireMock.RequestMessage,WireMock.Matchers.Request.RequestMatchResult)
IsMatch(WireMock.RequestMessage)