# WireMock.Matchers.Request.RequestMessageMethodMatcher - Coverage Report

# Summary

Class: | WireMock.Matchers.Request.RequestMessageMethodMatcher
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Matchers\Request\RequestMessageMethodMatcher.cs
Covered lines: | 13
Uncovered lines: | 0
Coverable lines: | 13
Total lines: | 48
Line coverage: | 100%

# Metrics

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

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Linq;`
|  | `2` |  | `using JetBrains.Annotations;`
|  | `3` |  | `using WireMock.Validation;`
|  | `4` |  | ``
|  | `5` |  | `namespace WireMock.Matchers.Request`
|  | `6` |  | `{`
|  | `7` |  | `/// <summary>`
|  | `8` |  | `/// The request verb matcher.`
|  | `9` |  | `/// </summary>`
|  | `10` |  | `internal class RequestMessageMethodMatcher : IRequestMatcher`
|  | `11` |  | `{`
|  | `12` |  | `/// <summary>`
|  | `13` |  | `/// The methods`
|  | `14` |  | `/// </summary>`
| 142 | `15` |  | `public string[] Methods { get; }`
|  | `16` |  | ``
|  | `17` |  | `/// <summary>`
|  | `18` |  | `/// Initializes a new instance of the <see cref="RequestMessageMethodMatcher"/> class.`
|  | `19` |  | `/// </summary>`
|  | `20` |  | `/// <param name="methods">`
|  | `21` |  | `/// The verb.`
|  | `22` |  | `/// </param>`
| 96 | `23` |  | `public RequestMessageMethodMatcher([NotNull] params string[] methods)`
| 96 | `24` |  | `{`
| 96 | `25` |  | `Check.NotNull(methods, nameof(methods));`
| 195 | `26` |  | `Methods = methods.Select(v => v.ToLower()).ToArray();`
| 96 | `27` |  | `}`
|  | `28` |  | ``
|  | `29` |  | `/// <summary>`
|  | `30` |  | `/// Determines whether the specified RequestMessage is match.`
|  | `31` |  | `/// </summary>`
|  | `32` |  | `/// <param name="requestMessage">The RequestMessage.</param>`
|  | `33` |  | `/// <param name="requestMatchResult">The RequestMatchResult.</param>`
|  | `34` |  | `/// <returns>`
|  | `35` |  | `/// A value between 0.0 - 1.0 of the similarity.`
|  | `36` |  | `/// </returns>`
|  | `37` |  | `public double GetMatchingScore(RequestMessage requestMessage, RequestMatchResult requestMatchResult)`
| 142 | `38` |  | `{`
| 142 | `39` |  | `double score = IsMatch(requestMessage);`
| 142 | `40` |  | `return requestMatchResult.AddScore(GetType(), score);`
| 142 | `41` |  | `}`
|  | `42` |  | ``
|  | `43` |  | `private double IsMatch(RequestMessage requestMessage)`
| 142 | `44` |  | `{`
| 142 | `45` |  | `return MatchScores.ToScore(Methods.Contains(requestMessage.Method));`
| 142 | `46` |  | `}`
|  | `47` |  | `}`
|  | `48` |  | `}`

# Methods/Properties

Methods()
.ctor(System.String[])
GetMatchingScore(WireMock.RequestMessage,WireMock.Matchers.Request.RequestMatchResult)
IsMatch(WireMock.RequestMessage)