# Summary

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

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
GetNamedGroups(...) | 0 | 0 | 1 | 1

# File(s)

## C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\Util\RegexUtils.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Collections.Generic;`
|  | `2` |  | `using System.Text.RegularExpressions;`
|  | `3` |  | ``
|  | `4` |  | `namespace WireMock.Util`
|  | `5` |  | `{`
|  | `6` |  | `internal static class RegexUtils`
|  | `7` |  | `{`
|  | `8` |  | `public static Dictionary<string, string> GetNamedGroups(Regex regex, string input)`
| 3 | `9` |  | `{`
| 3 | `10` |  | `var namedGroupsDictionary = new Dictionary<string, string>();`
|  | `11` |  | ``
| 3 | `12` |  | `GroupCollection groups = regex.Match(input).Groups;`
| 27 | `13` |  | `foreach (string groupName in regex.GetGroupNames())`
| 9 | `14` |  | `{`
| 9 | `15` |  | `if (groups[groupName].Captures.Count > 0)`
| 3 | `16` |  | `{`
| 3 | `17` |  | `namedGroupsDictionary.Add(groupName, groups[groupName].Value);`
| 3 | `18` |  | `}`
| 9 | `19` |  | `}`
|  | `20` |  | ``
| 3 | `21` |  | `return namedGroupsDictionary;`
| 3 | `22` |  | `}`
|  | `23` |  | `}`
|  | `24` |  | `}`

# Methods/Properties

GetNamedGroups(System.Text.RegularExpressions.Regex,System.String)