< Summary

Information
Class: Renci.SshNet.Sftp.Requests.SftpRmDirRequest
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpRmDirRequest.cs
Line coverage
82%
Covered lines: 19
Uncovered lines: 4
Coverable lines: 23
Total lines: 60
Line coverage: 82.6%
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_Path()100%1100%
set_Path(...)100%1100%
get_Encoding()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\SftpRmDirRequest.cs

#LineLine coverage
 1using System;
 2using System.Text;
 3using Renci.SshNet.Sftp.Responses;
 4
 5namespace Renci.SshNet.Sftp.Requests
 6{
 7    internal sealed class SftpRmDirRequest : SftpRequest
 8    {
 9        private byte[] _path;
 10
 11        public override SftpMessageTypes SftpMessageType
 12        {
 13213            get { return SftpMessageTypes.RmDir; }
 14        }
 15
 16        public string Path
 17        {
 918            get { return Encoding.GetString(_path, 0, _path.Length); }
 14119            private set { _path = Encoding.GetBytes(value); }
 20        }
 21
 10022        public Encoding Encoding { get; private set; }
 23
 24        /// <summary>
 25        /// Gets the size of the message in bytes.
 26        /// </summary>
 27        /// <value>
 28        /// The size of the messages in bytes.
 29        /// </value>
 30        protected override int BufferCapacity
 31        {
 32            get
 4133            {
 4134                var capacity = base.BufferCapacity;
 4135                capacity += 4; // Path length
 4136                capacity += _path.Length; // Path
 4137                return capacity;
 4138            }
 39        }
 40
 41        public SftpRmDirRequest(uint protocolVersion, uint requestId, string path, Encoding encoding, Action<SftpStatusR
 4742            : base(protocolVersion, requestId, statusAction)
 4743        {
 4744            Encoding = encoding;
 4745            Path = path;
 4746        }
 47
 48        protected override void LoadData()
 049        {
 050            base.LoadData();
 051            _path = ReadBinary();
 052        }
 53
 54        protected override void SaveData()
 4155        {
 4156            base.SaveData();
 4157            WriteBinaryString(_path);
 4158        }
 59    }
 60}