# < Summary

Information

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

Line coverage
95%

Covered lines: | 19
Uncovered lines: | 1
Coverable lines: | 20
Total lines: | 49
Line coverage: | 95%

Branch coverage
70%

Covered branches: | 7
Total branches: | 10
Branch coverage: | 70%

Method coverage

Feature is only available for sponsors

Upgrade to PRO version

# Metrics

Method | Branch coverage | Cyclomatic complexity | Line coverage
--- | --- | --- | ---
Create(...) | 70% | 10 | 85%

# File(s)

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

| # | Line |  | Line coverage
--- | --- | --- | --- | ---
|  | `1` |  | `using System;`
|  | `2` |  | `using System.Globalization;`
|  | `3` |  | `using System.Text;`
|  | `4` |  | ``
|  | `5` |  | `using Renci.SshNet.Sftp.Responses;`
|  | `6` |  | ``
|  | `7` |  | `namespace Renci.SshNet.Sftp`
|  | `8` |  | `{`
|  | `9` |  | `internal sealed class SftpResponseFactory : ISftpResponseFactory`
|  | `10` |  | `{`
|  | `11` |  | `public SftpMessage Create(uint protocolVersion, byte messageType, Encoding encoding)`
| 32102 | `12` |  | `{`
| 32102 | `13` |  | `var sftpMessageType = (SftpMessageTypes) messageType;`
|  | `14` |  | ``
|  | `15` |  | `SftpMessage message;`
|  | `16` |  | ``
|  | `17` |  | `#pragma warning disable IDE0010 // Add missing cases`
| 32102 | `18` |  | `switch (sftpMessageType)`
|  | `19` |  | `{`
|  | `20` |  | `case SftpMessageTypes.Version:`
| 626 | `21` |  | `message = new SftpVersionResponse();`
| 626 | `22` |  | `break;`
|  | `23` |  | `case SftpMessageTypes.Status:`
| 15101 | `24` |  | `message = new SftpStatusResponse(protocolVersion);`
| 15101 | `25` |  | `break;`
|  | `26` |  | `case SftpMessageTypes.Data:`
| 3952 | `27` |  | `message = new SftpDataResponse(protocolVersion);`
| 3952 | `28` |  | `break;`
|  | `29` |  | `case SftpMessageTypes.Handle:`
| 390 | `30` |  | `message = new SftpHandleResponse(protocolVersion);`
| 390 | `31` |  | `break;`
|  | `32` |  | `case SftpMessageTypes.Name:`
| 11618 | `33` |  | `message = new SftpNameResponse(protocolVersion, encoding);`
| 11618 | `34` |  | `break;`
|  | `35` |  | `case SftpMessageTypes.Attrs:`
| 409 | `36` |  | `message = new SftpAttrsResponse(protocolVersion);`
| 409 | `37` |  | `break;`
|  | `38` |  | `case SftpMessageTypes.ExtendedReply:`
| 6 | `39` |  | `message = new SftpExtendedReplyResponse(protocolVersion);`
| 6 | `40` |  | `break;`
|  | `41` |  | `default:`
| 0 | `42` |  | `throw new NotSupportedException(string.Format(CultureInfo.CurrentCulture, "Message type '{0}' is not`
|  | `43` |  | `}`
|  | `44` |  | `#pragma warning restore IDE0010 // Add missing cases`
|  | `45` |  | ``
| 32102 | `46` |  | `return message;`
| 32102 | `47` |  | `}`
|  | `48` |  | `}`
|  | `49` |  | `}`

# Methods/Properties

Create(System.UInt32,System.Byte,System.Text.Encoding)