# WireMock.ResponseMessage - Coverage Report

# Summary

Class: | WireMock.ResponseMessage
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\ResponseMessage.cs
Covered lines: | 20
Uncovered lines: | 0
Coverable lines: | 20
Total lines: | 91
Line coverage: | 100%
Branch coverage: | 50%

# Metrics

Method | Cyclomatic complexity | NPath complexity | Sequence coverage | Branch coverage
--- | --- | --- | --- | ---
AddHeader(...) | 1 | 0 | 100 | 100
AddHeader(...) | 3 | 2 | 100 | 66.67
.ctor() | 1 | 0 | 100 | 100

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System.Collections.Concurrent;`
|  | `2` |  | `using System.Collections.Generic;`
|  | `3` |  | `using System.Linq;`
|  | `4` |  | `using System.Text;`
|  | `5` |  | `using WireMock.Util;`
|  | `6` |  | `using WireMock.Validation;`
|  | `7` |  | ``
|  | `8` |  | `namespace WireMock`
|  | `9` |  | `{`
|  | `10` |  | `/// <summary>`
|  | `11` |  | `/// The response.`
|  | `12` |  | `/// </summary>`
|  | `13` |  | `public class ResponseMessage`
|  | `14` |  | `{`
|  | `15` |  | `/// <summary>`
|  | `16` |  | `/// Gets the headers.`
|  | `17` |  | `/// </summary>`
| 362 | `18` |  | `public IDictionary<string, WireMockList<string>> Headers { get; set; } = new ConcurrentDictionary<string, WireMo`
|  | `19` |  | ``
|  | `20` |  | `/// <summary>`
|  | `21` |  | `/// Gets or sets the status code.`
|  | `22` |  | `/// </summary>`
| 270 | `23` |  | `public int StatusCode { get; set; } = 200;`
|  | `24` |  | ``
|  | `25` |  | `/// <summary>`
|  | `26` |  | `/// Gets or sets the body.`
|  | `27` |  | `/// </summary>`
| 7 | `28` |  | `public string BodyOriginal { get; set; }`
|  | `29` |  | ``
|  | `30` |  | `/// <summary>`
|  | `31` |  | `/// Gets or sets the body destination (SameAsSource, String or Bytes).`
|  | `32` |  | `/// </summary>`
| 39 | `33` |  | `public string BodyDestination { get; set; }`
|  | `34` |  | ``
|  | `35` |  | `/// <summary>`
|  | `36` |  | `/// Gets or sets the body as a string.`
|  | `37` |  | `/// </summary>`
| 174 | `38` |  | `public string Body { get; set; }`
|  | `39` |  | ``
|  | `40` |  | `/// <summary>`
|  | `41` |  | `/// Gets or sets the body as a json object.`
|  | `42` |  | `/// </summary>`
| 112 | `43` |  | `public object BodyAsJson { get; set; }`
|  | `44` |  | ``
|  | `45` |  | `/// <summary>`
|  | `46` |  | `/// Gets or sets the body as bytes.`
|  | `47` |  | `/// </summary>`
| 129 | `48` |  | `public byte[] BodyAsBytes { get; set; }`
|  | `49` |  | ``
|  | `50` |  | `/// <summary>`
|  | `51` |  | `/// Gets or sets the body as a file.`
|  | `52` |  | `/// </summary>`
| 56 | `53` |  | `public string BodyAsFile { get; set; }`
|  | `54` |  | ``
|  | `55` |  | `/// <summary>`
|  | `56` |  | `/// Is the body as file cached?`
|  | `57` |  | `/// </summary>`
| 3 | `58` |  | `public bool? BodyAsFileIsCached { get; set; }`
|  | `59` |  | ``
|  | `60` |  | `/// <summary>`
|  | `61` |  | `/// Gets or sets the body encoding.`
|  | `62` |  | `/// </summary>`
| 181 | `63` |  | `public Encoding BodyEncoding { get; set; } = new UTF8Encoding(false);`
|  | `64` |  | ``
|  | `65` |  | `/// <summary>`
|  | `66` |  | `/// Adds the header.`
|  | `67` |  | `/// </summary>`
|  | `68` |  | `/// <param name="name">The name.</param>`
|  | `69` |  | `/// <param name="value">The value.</param>`
|  | `70` |  | `public void AddHeader(string name, string value)`
| 1 | `71` |  | `{`
| 1 | `72` |  | `Headers.Add(name, new WireMockList<string>(value));`
| 1 | `73` |  | `}`
|  | `74` |  | ``
|  | `75` |  | `/// <summary>`
|  | `76` |  | `/// Adds the header.`
|  | `77` |  | `/// </summary>`
|  | `78` |  | `/// <param name="name">The name.</param>`
|  | `79` |  | `/// <param name="values">The values.</param>`
|  | `80` |  | `public void AddHeader(string name, params string[] values)`
| 91 | `81` |  | `{`
| 91 | `82` |  | `Check.NotNullOrEmpty(values, nameof(values));`
|  | `83` |  | ``
| 91 | `84` |  | `var newHeaderValues = Headers.TryGetValue(name, out WireMockList<string> existingValues)`
| 91 | `85` |  | `? values.Union(existingValues).ToArray()`
| 91 | `86` |  | `: values;`
|  | `87` |  | ``
| 91 | `88` |  | `Headers[name] = new WireMockList<string>(newHeaderValues);`
| 91 | `89` |  | `}`
|  | `90` |  | `}`
|  | `91` |  | `}`

# Methods/Properties

Headers()
Headers(System.Collections.Generic.IDictionary`2<System.String,WireMock.Util.WireMockList`1<System.String>>)
.ctor()
StatusCode()
StatusCode(System.Int32)
BodyOriginal()
BodyOriginal(System.String)
BodyDestination()
BodyDestination(System.String)
Body()
Body(System.String)
BodyAsJson()
BodyAsJson(System.Object)
BodyAsBytes()
BodyAsBytes(System.Byte[])
BodyAsFile()
BodyAsFile(System.String)
BodyAsFileIsCached()
BodyAsFileIsCached(System.Nullable`1<System.Boolean>)
BodyEncoding()
BodyEncoding(System.Text.Encoding)
AddHeader(System.String,System.String)
AddHeader(System.String,System.String[])