# < Summary

Information

Class: | Renci.SshNet.Sftp.Requests.SftpRequest
Assembly: | Renci.SshNet
File(s): | \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpRequest.cs

Line coverage
85%

Covered lines: | 23
Uncovered lines: | 4
Coverable lines: | 27
Total lines: | 61
Line coverage: | 85.1%

Branch coverage
50%

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

Method coverage

Feature is only available for sponsors

Upgrade to PRO version

# Metrics

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
get_RequestId() | 100% | 1 | 100%
get_ProtocolVersion() | 100% | 1 | 100%
get_BufferCapacity() | 100% | 1 | 100%
.ctor(...) | 100% | 1 | 100%
Complete(...) | 50% | 2 | 75%
LoadData() | 100% | 1 | 0%
SaveData() | 100% | 1 | 100%

# File(s)

## \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpRequest.cs

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using Renci.SshNet.Sftp.Responses;`
|  | `3` |  | ``
|  | `4` |  | `namespace Renci.SshNet.Sftp.Requests`
|  | `5` |  | `{`
|  | `6` |  | `internal abstract class SftpRequest : SftpMessage`
|  | `7` |  | `{`
|  | `8` |  | `private readonly Action<SftpStatusResponse> _statusAction;`
|  | `9` |  | ``
| 63252 | `10` |  | `public uint RequestId { get; }`
|  | `11` |  | ``
| 75 | `12` |  | `public uint ProtocolVersion { get; }`
|  | `13` |  | ``
|  | `14` |  | `/// <summary>`
|  | `15` |  | `/// Gets the size of the message in bytes.`
|  | `16` |  | `/// </summary>`
|  | `17` |  | `/// <value>`
|  | `18` |  | `/// The size of the messages in bytes.`
|  | `19` |  | `/// </value>`
|  | `20` |  | `protected override int BufferCapacity`
|  | `21` |  | `{`
|  | `22` |  | `get`
| 31656 | `23` |  | `{`
| 31656 | `24` |  | `var capacity = base.BufferCapacity;`
| 31656 | `25` |  | `capacity += 4; // RequestId`
| 31656 | `26` |  | `return capacity;`
| 31656 | `27` |  | `}`
|  | `28` |  | `}`
|  | `29` |  | ``
| 31842 | `30` |  | `protected SftpRequest(uint protocolVersion, uint requestId, Action<SftpStatusResponse> statusAction)`
| 31842 | `31` |  | `{`
| 31842 | `32` |  | `RequestId = requestId;`
| 31842 | `33` |  | `ProtocolVersion = protocolVersion;`
| 31842 | `34` |  | `_statusAction = statusAction;`
| 31842 | `35` |  | `}`
|  | `36` |  | ``
|  | `37` |  | `public virtual void Complete(SftpResponse response)`
| 15176 | `38` |  | `{`
| 15176 | `39` |  | `if (response is SftpStatusResponse statusResponse)`
| 15176 | `40` |  | `{`
| 15176 | `41` |  | `_statusAction(statusResponse);`
| 15176 | `42` |  | `}`
|  | `43` |  | `else`
| 0 | `44` |  | `{`
| 0 | `45` |  | `throw new InvalidOperationException(string.Format("Response of type '{0}' is not expected.", response.Ge`
|  | `46` |  | `}`
| 15176 | `47` |  | `}`
|  | `48` |  | ``
|  | `49` |  | `protected override void LoadData()`
| 0 | `50` |  | `{`
| 0 | `51` |  | `throw new InvalidOperationException("Request cannot be saved.");`
|  | `52` |  | `}`
|  | `53` |  | ``
|  | `54` |  | `protected override void SaveData()`
| 31656 | `55` |  | `{`
| 31656 | `56` |  | `base.SaveData();`
|  | `57` |  | ``
| 31656 | `58` |  | `Write(RequestId);`
| 31656 | `59` |  | `}`
|  | `60` |  | `}`
|  | `61` |  | `}`

# Methods/Properties

get_RequestId()
get_ProtocolVersion()
get_BufferCapacity()
.ctor(System.UInt32,System.UInt32,System.Action`1<Renci.SshNet.Sftp.Responses.SftpStatusResponse>)
Complete(Renci.SshNet.Sftp.Responses.SftpResponse)
LoadData()
SaveData()