# WireMock.Serialization.MatcherMapper - Coverage Report

# Summary

Class: | WireMock.Serialization.MatcherMapper
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Serialization\MatcherMapper.cs
Covered lines: | 17
Uncovered lines: | 0
Coverable lines: | 17
Total lines: | 35
Line coverage: | 100%
Branch coverage: | 90%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
Map(...) | 4 | 2 | 100 | 100
Map(...) | 9 | 16 | 100 | 88.89

# File(s)

## C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Serialization\MatcherMapper.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Collections.Generic;`
|  | `2` |  | `using System.Linq;`
|  | `3` |  | `using JetBrains.Annotations;`
|  | `4` |  | `using WireMock.Admin.Mappings;`
|  | `5` |  | `using WireMock.Matchers;`
|  | `6` |  | ``
|  | `7` |  | `namespace WireMock.Serialization`
|  | `8` |  | `{`
|  | `9` |  | `internal static class MatcherMapper`
|  | `10` |  | `{`
|  | `11` |  | `public static MatcherModel[] Map([CanBeNull] IEnumerable<IMatcher> matchers)`
| 2 | `12` |  | `{`
| 4 | `13` |  | `return matchers?.Select(Map).Where(x => x != null).ToArray();`
| 2 | `14` |  | `}`
|  | `15` |  | ``
|  | `16` |  | `public static MatcherModel Map([CanBeNull] IMatcher matcher)`
| 5 | `17` |  | `{`
| 5 | `18` |  | `if (matcher == null)`
| 1 | `19` |  | `{`
| 1 | `20` |  | `return null;`
|  | `21` |  | `}`
|  | `22` |  | ``
| 4 | `23` |  | `string[] patterns = matcher is IStringMatcher stringMatcher ? stringMatcher.GetPatterns() : new string[0];`
| 4 | `24` |  | `bool? ignorecase = matcher is IIgnoreCaseMatcher ignoreCaseMatcher ? ignoreCaseMatcher.IgnoreCase : (bool?)n`
|  | `25` |  | ``
| 4 | `26` |  | `return new MatcherModel`
| 4 | `27` |  | `{`
| 4 | `28` |  | `IgnoreCase = ignorecase,`
| 4 | `29` |  | `Name = matcher.GetName(),`
| 4 | `30` |  | `Pattern = patterns.Length == 1 ? patterns.First() : null,`
| 4 | `31` |  | `Patterns = patterns.Length > 1 ? patterns : null`
| 4 | `32` |  | `};`
| 5 | `33` |  | `}`
|  | `34` |  | `}`
|  | `35` |  | `}`

# Methods/Properties

Map(System.Collections.Generic.IEnumerable`1<WireMock.Matchers.IMatcher>)
Map(WireMock.Matchers.IMatcher)