# Summary

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

# Metrics

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

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.IO;`
|  | `2` |  | `using System.Threading;`
|  | `3` |  | `using JetBrains.Annotations;`
|  | `4` |  | `using WireMock.Handlers;`
|  | `5` |  | `using WireMock.Validation;`
|  | `6` |  | ``
|  | `7` |  | `namespace WireMock.Util`
|  | `8` |  | `{`
|  | `9` |  | `internal static class FileHelper`
|  | `10` |  | `{`
|  | `11` |  | `private const int NumberOfRetries = 3;`
|  | `12` |  | `private const int DelayOnRetry = 500;`
|  | `13` |  | ``
|  | `14` |  | `public static string ReadAllTextWithRetryAndDelay([NotNull] IFileSystemHandler filehandler, [NotNull] string pat`
| 2 | `15` |  | `{`
| 2 | `16` |  | `Check.NotNull(filehandler, nameof(filehandler));`
| 2 | `17` |  | `Check.NotNullOrEmpty(path, nameof(path));`
|  | `18` |  | ``
| 10 | `19` |  | `for (int i = 1; i <= NumberOfRetries; ++i)`
| 4 | `20` |  | `{`
|  | `21` |  | `try`
| 4 | `22` |  | `{`
| 4 | `23` |  | `return filehandler.ReadMappingFile(path);`
|  | `24` |  | `}`
| 3 | `25` |  | `catch`
| 3 | `26` |  | `{`
| 3 | `27` |  | `Thread.Sleep(DelayOnRetry);`
| 3 | `28` |  | `}`
| 3 | `29` |  | `}`
|  | `30` |  | ``
| 1 | `31` |  | `throw new IOException();`
| 1 | `32` |  | `}`
|  | `33` |  | `}`
|  | `34` |  | `}`

# Methods/Properties

ReadAllTextWithRetryAndDelay(WireMock.Handlers.IFileSystemHandler,System.String)