# 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

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
Loop(...) | 4 | 2 | 100 | 100

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Collections.Generic;`
|  | `3` |  | `using JetBrains.Annotations;`
|  | `4` |  | `using WireMock.Validation;`
|  | `5` |  | ``
|  | `6` |  | `namespace 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>`
| 6 | `21` |  | `{`
| 6 | `22` |  | `Check.NotNull(action, nameof(action));`
|  | `23` |  | ``
| 6 | `24` |  | `if (dictionary != null)`
| 2 | `25` |  | `{`
| 32 | `26` |  | `foreach (var entry in dictionary)`
| 13 | `27` |  | `{`
| 13 | `28` |  | `action(entry.Key, entry.Value);`
| 13 | `29` |  | `}`
| 2 | `30` |  | `}`
| 6 | `31` |  | `}`
|  | `32` |  | `}`
|  | `33` |  | `}`

# Methods/Properties

Loop(System.Collections.Generic.IDictionary`2<TKey,TValue>,System.Action`2<TKey,TValue>)