# WireMock.Util.FileHelper - Coverage Report

# 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: | 6
Uncovered lines: | 6
Coverable lines: | 12
Total lines: | 29
Line coverage: | 50%
Branch coverage: | 50%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
ReadAllText(...) | 2 | 2 | 50 | 66.67

# 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` |  | ``
|  | `4` |  | `namespace WireMock.Util`
|  | `5` |  | `{`
|  | `6` |  | `internal static class FileHelper`
|  | `7` |  | `{`
|  | `8` |  | `private const int NumberOfRetries = 3;`
|  | `9` |  | `private const int DelayOnRetry = 500;`
|  | `10` |  | ``
|  | `11` |  | `public static string ReadAllText(string path)`
| 4 | `12` |  | `{`
| 8 | `13` |  | `for (int i = 1; i <= NumberOfRetries; ++i)`
| 4 | `14` |  | `{`
|  | `15` |  | `try`
| 4 | `16` |  | `{`
| 4 | `17` |  | `return File.ReadAllText(path);`
|  | `18` |  | `}`
| 0 | `19` |  | `catch`
| 0 | `20` |  | `{`
|  | `21` |  | `// You may check error code to filter some exceptions, not every error can be recovered.`
| 0 | `22` |  | `Thread.Sleep(DelayOnRetry);`
| 0 | `23` |  | `}`
| 0 | `24` |  | `}`
|  | `25` |  | ``
| 0 | `26` |  | `throw new IOException();`
| 4 | `27` |  | `}`
|  | `28` |  | `}`
|  | `29` |  | `}`

# Methods/Properties

ReadAllText(System.String)