# Summary

Class: | WireMock.ResponseMessage
Assembly: | WireMock.Net
File(s): | C:\Users\azureuser\Documents\Github\WireMock.Net\src\WireMock.Net\ResponseMessage.cs
Covered lines: | 18
Uncovered lines: | 3
Coverable lines: | 21
Total lines: | 95
Line coverage: | 85.7%
Branch coverage: | 50%

# Metrics

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

# File(s)

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

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

# Methods/Properties

Headers()
StatusCode()
BodyOriginal()
BodyDestination()
Body()
BodyAsJson()
BodyAsJsonIndented()
BodyAsBytes()
BodyAsFile()
BodyAsFileIsCached()
BodyEncoding()
AddHeader(System.String,System.String)
AddHeader(System.String,System.String[])