< Summary

Information
Class: Renci.SshNet.Sftp.Requests.SftpCloseRequest
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpCloseRequest.cs
Line coverage
80%
Covered lines: 16
Uncovered lines: 4
Coverable lines: 20
Total lines: 50
Line coverage: 80%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_SftpMessageType()100%1100%
get_Handle()100%1100%
get_BufferCapacity()100%1100%
.ctor(...)100%1100%
LoadData()100%10%
SaveData()100%1100%

File(s)

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

#LineLine coverage
 1using System;
 2using Renci.SshNet.Sftp.Responses;
 3
 4namespace Renci.SshNet.Sftp.Requests
 5{
 6    internal sealed class SftpCloseRequest : SftpRequest
 7    {
 8        public override SftpMessageTypes SftpMessageType
 9        {
 118810            get { return SftpMessageTypes.Close; }
 11        }
 12
 118813        public byte[] Handle { get; private set; }
 14
 15        /// <summary>
 16        /// Gets the size of the message in bytes.
 17        /// </summary>
 18        /// <value>
 19        /// The size of the messages in bytes.
 20        /// </value>
 21        protected override int BufferCapacity
 22        {
 23            get
 39324            {
 39325                var capacity = base.BufferCapacity;
 39326                capacity += 4; // Handle length
 39327                capacity += Handle.Length; // Handle
 39328                return capacity;
 39329            }
 30        }
 31
 32        public SftpCloseRequest(uint protocolVersion, uint requestId, byte[] handle, Action<SftpStatusResponse> statusAc
 39933            : base(protocolVersion, requestId, statusAction)
 39934        {
 39935            Handle = handle;
 39936        }
 37
 38        protected override void LoadData()
 039        {
 040            base.LoadData();
 041            Handle = ReadBinary();
 042        }
 43
 44        protected override void SaveData()
 39345        {
 39346            base.SaveData();
 39347            WriteBinaryString(Handle);
 39348        }
 49    }
 50}