Summary

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

Metrics

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

File(s)

C:\Users\StefHeyenrath\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> 
 021        {
 022            Check.NotNull(action, nameof(action));
 23
 024            if (dictionary != null)
 025            {
 026                foreach (var entry in dictionary)
 027                {
 028                    action(entry.Key, entry.Value);
 029                }
 030            }
 031        }
 32    }
 33}