# Summary

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

# Metrics

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

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Collections.Generic;`
|  | `2` |  | `using System.Linq;`
|  | `3` |  | `using JetBrains.Annotations;`
|  | `4` |  | `using WireMock.Validation;`
|  | `5` |  | ``
|  | `6` |  | `namespace WireMock.Matchers.Request`
|  | `7` |  | `{`
|  | `8` |  | `/// <summary>`
|  | `9` |  | `/// The composite request matcher.`
|  | `10` |  | `/// </summary>`
|  | `11` |  | `public abstract class RequestMessageCompositeMatcher : IRequestMatcher`
|  | `12` |  | `{`
|  | `13` |  | `private readonly CompositeMatcherType _type;`
|  | `14` |  | ``
|  | `15` |  | `/// <summary>`
|  | `16` |  | `/// Gets the request matchers.`
|  | `17` |  | `/// </summary>`
|  | `18` |  | `/// <value>`
|  | `19` |  | `/// The request matchers.`
|  | `20` |  | `/// </value>`
| 401 | `21` |  | `private IEnumerable<IRequestMatcher> RequestMatchers { get; }`
|  | `22` |  | ``
|  | `23` |  | `/// <summary>`
|  | `24` |  | `/// Initializes a new instance of the <see cref="RequestMessageCompositeMatcher"/> class.`
|  | `25` |  | `/// </summary>`
|  | `26` |  | `/// <param name="requestMatchers">The request matchers.</param>`
|  | `27` |  | `/// <param name="type">The CompositeMatcherType type (Defaults to 'And')</param>`
| 155 | `28` |  | `protected RequestMessageCompositeMatcher([NotNull] IEnumerable<IRequestMatcher> requestMatchers, CompositeMatche`
| 155 | `29` |  | `{`
| 155 | `30` |  | `Check.NotNull(requestMatchers, nameof(requestMatchers));`
|  | `31` |  | ``
| 155 | `32` |  | `_type = type;`
| 155 | `33` |  | `RequestMatchers = requestMatchers;`
| 155 | `34` |  | `}`
|  | `35` |  | ``
|  | `36` |  | `/// <inheritdoc cref="IRequestMatcher.GetMatchingScore"/>`
|  | `37` |  | `public double GetMatchingScore(RequestMessage requestMessage, RequestMatchResult requestMatchResult)`
| 201 | `38` |  | `{`
| 201 | `39` |  | `if (!RequestMatchers.Any())`
| 1 | `40` |  | `{`
| 1 | `41` |  | `return MatchScores.Mismatch;`
|  | `42` |  | `}`
|  | `43` |  | ``
| 200 | `44` |  | `if (_type == CompositeMatcherType.And)`
| 199 | `45` |  | `{`
| 557 | `46` |  | `return RequestMatchers.Average(requestMatcher => requestMatcher.GetMatchingScore(requestMessage, request`
|  | `47` |  | `}`
|  | `48` |  | ``
| 3 | `49` |  | `return RequestMatchers.Max(requestMatcher => requestMatcher.GetMatchingScore(requestMessage, requestMatchRes`
| 201 | `50` |  | `}`
|  | `51` |  | `}`
|  | `52` |  | `}`

# Methods/Properties

RequestMatchers()
.ctor(System.Collections.Generic.IEnumerable`1<WireMock.Matchers.Request.IRequestMatcher>,WireMock.Matchers.Request.CompositeMatcherType)
GetMatchingScore(WireMock.RequestMessage,WireMock.Matchers.Request.RequestMatchResult)