# < Summary

Information

Class: | Renci.SshNet.Messages.Connection.ExecRequestInfo
Assembly: | Renci.SshNet
File(s): | \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelRequest\ExecRequestInfo.cs

Line coverage
69%

Covered lines: | 23
Uncovered lines: | 10
Coverable lines: | 33
Total lines: | 117
Line coverage: | 69.6%

Branch coverage
50%

Covered branches: | 2
Total branches: | 4
Branch coverage: | 50%

Method coverage

Feature is only available for sponsors

Upgrade to PRO version

# Metrics

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
get_RequestName() | 100% | 1 | 100%
get_Command() | 100% | 1 | 0%
get_Encoding() | 100% | 1 | 100%
get_BufferCapacity() | 100% | 1 | 100%
.ctor() | 100% | 1 | 100%
.ctor(...) | 50% | 4 | 63.63%
LoadData() | 100% | 1 | 0%
SaveData() | 100% | 1 | 100%

# File(s)

## \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelRequest\ExecRequestInfo.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Text;`
|  | `3` |  | ``
|  | `4` |  | `namespace Renci.SshNet.Messages.Connection`
|  | `5` |  | `{`
|  | `6` |  | `/// <summary>`
|  | `7` |  | `/// Represents "exec" type channel request information.`
|  | `8` |  | `/// </summary>`
|  | `9` |  | `internal sealed class ExecRequestInfo : RequestInfo`
|  | `10` |  | `{`
|  | `11` |  | `private byte[] _command;`
|  | `12` |  | ``
|  | `13` |  | `/// <summary>`
|  | `14` |  | `/// Channel request name.`
|  | `15` |  | `/// </summary>`
|  | `16` |  | `public const string Name = "exec";`
|  | `17` |  | ``
|  | `18` |  | `/// <summary>`
|  | `19` |  | `/// Gets the name of the request.`
|  | `20` |  | `/// </summary>`
|  | `21` |  | `/// <value>`
|  | `22` |  | `/// The name of the request.`
|  | `23` |  | `/// </value>`
|  | `24` |  | `public override string RequestName`
|  | `25` |  | `{`
| 3225 | `26` |  | `get { return Name; }`
|  | `27` |  | `}`
|  | `28` |  | ``
|  | `29` |  | `/// <summary>`
|  | `30` |  | `/// Gets command to execute.`
|  | `31` |  | `/// </summary>`
|  | `32` |  | `/// <value>`
|  | `33` |  | `/// The command.`
|  | `34` |  | `/// </value>`
|  | `35` |  | `public string Command`
|  | `36` |  | `{`
| 0 | `37` |  | `get { return Encoding.GetString(_command, 0, _command.Length); }`
|  | `38` |  | `}`
|  | `39` |  | ``
|  | `40` |  | `/// <summary>`
|  | `41` |  | `/// Gets the encoding.`
|  | `42` |  | `/// </summary>`
|  | `43` |  | `/// <value>`
|  | `44` |  | `/// The encoding.`
|  | `45` |  | `/// </value>`
| 1075 | `46` |  | `public Encoding Encoding { get; private set; }`
|  | `47` |  | ``
|  | `48` |  | `/// <summary>`
|  | `49` |  | `/// Gets the size of the message in bytes.`
|  | `50` |  | `/// </summary>`
|  | `51` |  | `/// <value>`
|  | `52` |  | `/// The size of the messages in bytes.`
|  | `53` |  | `/// </value>`
|  | `54` |  | `protected override int BufferCapacity`
|  | `55` |  | `{`
|  | `56` |  | `get`
| 1075 | `57` |  | `{`
| 1075 | `58` |  | `var capacity = base.BufferCapacity;`
| 1075 | `59` |  | `capacity += 4; // Command length`
| 1075 | `60` |  | `capacity += _command.Length; // Command`
| 1075 | `61` |  | `return capacity;`
| 1075 | `62` |  | `}`
|  | `63` |  | `}`
|  | `64` |  | ``
|  | `65` |  | `/// <summary>`
|  | `66` |  | `/// Initializes a new instance of the <see cref="ExecRequestInfo"/> class.`
|  | `67` |  | `/// </summary>`
| 3879 | `68` |  | `public ExecRequestInfo()`
| 3879 | `69` |  | `{`
| 3879 | `70` |  | `WantReply = true;`
| 3879 | `71` |  | `}`
|  | `72` |  | ``
|  | `73` |  | `/// <summary>`
|  | `74` |  | `/// Initializes a new instance of the <see cref="ExecRequestInfo"/> class.`
|  | `75` |  | `/// </summary>`
|  | `76` |  | `/// <param name="command">The command.</param>`
|  | `77` |  | `/// <param name="encoding">The character encoding to use.</param>`
|  | `78` |  | `/// <exception cref="ArgumentNullException"><paramref name="command"/> or <paramref name="encoding"/> is <see la`
|  | `79` |  | `public ExecRequestInfo(string command, Encoding encoding)`
| 1075 | `80` |  | `: this()`
| 1075 | `81` |  | `{`
| 1075 | `82` |  | `if (command is null)`
| 0 | `83` |  | `{`
| 0 | `84` |  | `throw new ArgumentNullException(nameof(command));`
|  | `85` |  | `}`
|  | `86` |  | ``
| 1075 | `87` |  | `if (encoding is null)`
| 0 | `88` |  | `{`
| 0 | `89` |  | `throw new ArgumentNullException(nameof(encoding));`
|  | `90` |  | `}`
|  | `91` |  | ``
| 1075 | `92` |  | `_command = encoding.GetBytes(command);`
| 1075 | `93` |  | `Encoding = encoding;`
| 1075 | `94` |  | `}`
|  | `95` |  | ``
|  | `96` |  | `/// <summary>`
|  | `97` |  | `/// Called when type specific data need to be loaded.`
|  | `98` |  | `/// </summary>`
|  | `99` |  | `protected override void LoadData()`
| 0 | `100` |  | `{`
| 0 | `101` |  | `base.LoadData();`
|  | `102` |  | ``
| 0 | `103` |  | `_command = ReadBinary();`
| 0 | `104` |  | `Encoding = Utf8;`
| 0 | `105` |  | `}`
|  | `106` |  | ``
|  | `107` |  | `/// <summary>`
|  | `108` |  | `/// Called when type specific data need to be saved.`
|  | `109` |  | `/// </summary>`
|  | `110` |  | `protected override void SaveData()`
| 1075 | `111` |  | `{`
| 1075 | `112` |  | `base.SaveData();`
|  | `113` |  | ``
| 1075 | `114` |  | `WriteBinaryString(_command);`
| 1075 | `115` |  | `}`
|  | `116` |  | `}`
|  | `117` |  | `}`

# Methods/Properties

get_RequestName()
get_Command()
get_Encoding()
get_BufferCapacity()
.ctor()
.ctor(System.String,System.Text.Encoding)
LoadData()
SaveData()