Summary

Class:WireMock.Util.RegexUtils
Assembly:WireMock.Net
File(s):C:\Users\StefHeyenrath\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

MethodCyclomatic complexity NPath complexity Sequence coverage Branch coverage
GetNamedGroups(...)0011

File(s)

C:\Users\StefHeyenrath\Documents\GitHub\WireMock.Net\src\WireMock.Net\Util\RegexUtils.cs

#LineLine coverage
 1using System.Collections.Generic;
 2using System.Text.RegularExpressions;
 3
 4namespace WireMock.Util
 5{
 6    internal static class RegexUtils
 7    {
 8        public static Dictionary<string, string> GetNamedGroups(Regex regex, string input)
 39        {
 310            var namedGroupsDictionary = new Dictionary<string, string>();
 11
 312            GroupCollection groups = regex.Match(input).Groups;
 2713            foreach (string groupName in regex.GetGroupNames())
 914            {
 915                if (groups[groupName].Captures.Count > 0)
 316                {
 317                    namedGroupsDictionary.Add(groupName, groups[groupName].Value);
 318                }
 919            }
 20
 321            return namedGroupsDictionary;
 322        }
 23    }
 24}