# Summary

Class: | WireMock.Util.JsonUtils
Assembly: | WireMock.Net
File(s): | C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Util\JsonUtils.cs
Covered lines: | 6
Uncovered lines: | 2
Coverable lines: | 8
Total lines: | 19
Line coverage: | 75%
Branch coverage: | 50%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
ParseJTokenToObject(...) | 3 | 4 | 75 | 60

# File(s)

## C:\Users\Stef\Documents\GitHub\WireMock.Net\src\WireMock.Net\Util\JsonUtils.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using Newtonsoft.Json.Linq;`
|  | `2` |  | ``
|  | `3` |  | `namespace WireMock.Util`
|  | `4` |  | `{`
|  | `5` |  | `internal static class JsonUtils`
|  | `6` |  | `{`
|  | `7` |  | `public static T ParseJTokenToObject<T>(object value)`
| 4 | `8` |  | `{`
| 4 | `9` |  | `if (value == null)`
| 0 | `10` |  | `return default(T);`
|  | `11` |  | ``
| 4 | `12` |  | `JToken token = value as JToken;`
| 4 | `13` |  | `if (token == null)`
| 0 | `14` |  | `return default(T);`
|  | `15` |  | ``
| 4 | `16` |  | `return token.ToObject<T>();`
| 4 | `17` |  | `}`
|  | `18` |  | `}`
|  | `19` |  | `}`

# Methods/Properties

ParseJTokenToObject(System.Object)