Summary

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

Metrics

MethodCyclomatic complexity  NPath complexity  Sequence coverage  Branch coverage  
Loop(...)42100100

File(s)

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

#LineLine coverage
 1using System;
 2using System.Collections.Generic;
 3using JetBrains.Annotations;
 4using WireMock.Validation;
 5
 6namespace WireMock.Util
 7{
 8    /// <summary>
 9    /// Some IDictionary Extensions
 10    /// </summary>
 11    public static class DictionaryExtensions
 12    {
 13        /// <summary>
 14        /// Loops the dictionary and executes the specified action.
 15        /// </summary>
 16        /// <typeparam name="TKey">The type of the key.</typeparam>
 17        /// <typeparam name="TValue">The type of the value.</typeparam>
 18        /// <param name="dictionary">The dictionary to loop (can be null).</param>
 19        /// <param name="action">The action.</param>
 20        public static void Loop<TKey, TValue>(this IDictionary<TKey, TValue> dictionary, [NotNull] Action<TKey, TValue> 
 621        {
 622            Check.NotNull(action, nameof(action));
 23
 624             if (dictionary != null)
 225            {
 3226                foreach (var entry in dictionary)
 1327                {
 1328                    action(entry.Key, entry.Value);
 1329                }
 230            }
 631        }
 32    }
 33}