# WireMock.Matchers.Request.RequestMessageScenarioAndStateMatcher - Coverage Report

# Summary

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

# Metrics

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

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using JetBrains.Annotations;`
|  | `2` |  | ``
|  | `3` |  | `namespace WireMock.Matchers.Request`
|  | `4` |  | `{`
|  | `5` |  | `/// <summary>`
|  | `6` |  | `/// The scenario and state matcher.`
|  | `7` |  | `/// </summary>`
|  | `8` |  | `internal class RequestMessageScenarioAndStateMatcher : IRequestMatcher`
|  | `9` |  | `{`
|  | `10` |  | `///// <summary>`
|  | `11` |  | `///// Scenario.`
|  | `12` |  | `///// </summary>`
|  | `13` |  | `//[CanBeNull] private string _scenario;`
|  | `14` |  | ``
|  | `15` |  | `/// <summary>`
|  | `16` |  | `/// Execution state condition for the current mapping.`
|  | `17` |  | `/// </summary>`
|  | `18` |  | `[CanBeNull]`
|  | `19` |  | `private readonly object _executionConditionState;`
|  | `20` |  | ``
|  | `21` |  | `/// <summary>`
|  | `22` |  | `/// The next state which will be signaled after the current mapping execution.`
|  | `23` |  | `/// In case the value is null state will not be changed.`
|  | `24` |  | `/// </summary>`
|  | `25` |  | `[CanBeNull]`
|  | `26` |  | `private readonly object _nextState;`
|  | `27` |  | ``
|  | `28` |  | `/// <summary>`
|  | `29` |  | `/// Initializes a new instance of the <see cref="RequestMessageScenarioAndStateMatcher"/> class.`
|  | `30` |  | `/// </summary>`
|  | `31` |  | `/// <param name="nextState">The next state.</param>`
|  | `32` |  | `/// <param name="executionConditionState">Execution state condition for the current mapping.</param>`
| 14 | `33` |  | `public RequestMessageScenarioAndStateMatcher([CanBeNull] object nextState, [CanBeNull] object executionCondition`
| 14 | `34` |  | `{`
| 14 | `35` |  | `_nextState = nextState;`
| 14 | `36` |  | `_executionConditionState = executionConditionState;`
| 14 | `37` |  | `}`
|  | `38` |  | ``
|  | `39` |  | `/// <inheritdoc />`
|  | `40` |  | `public double GetMatchingScore(RequestMessage requestMessage, RequestMatchResult requestMatchResult)`
| 14 | `41` |  | `{`
| 14 | `42` |  | `double score = IsMatch();`
| 14 | `43` |  | `return requestMatchResult.AddScore(GetType(), score);`
| 14 | `44` |  | `}`
|  | `45` |  | ``
|  | `46` |  | `private double IsMatch()`
| 14 | `47` |  | `{`
| 14 | `48` |  | `return Equals(_executionConditionState, _nextState) ? MatchScores.Perfect : MatchScores.Mismatch;`
| 14 | `49` |  | `}`
|  | `50` |  | `}`
|  | `51` |  | `}`

# Methods/Properties

.ctor(System.Object,System.Object)
GetMatchingScore(WireMock.RequestMessage,WireMock.Matchers.Request.RequestMatchResult)
IsMatch()