< Summary

Information
Class: Renci.SshNet.Sftp.Requests.SftpRemoveRequest
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpRemoveRequest.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_Filename()100%1100%
set_Filename(...)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\SftpRemoveRequest.cs

#LineLine coverage
 1using System;
 2using System.Text;
 3using Renci.SshNet.Sftp.Responses;
 4
 5namespace Renci.SshNet.Sftp.Requests
 6{
 7    internal sealed class SftpRemoveRequest : SftpRequest
 8    {
 9        private byte[] _fileName;
 10
 11        public override SftpMessageTypes SftpMessageType
 12        {
 50413            get { return SftpMessageTypes.Remove; }
 14        }
 15
 16        public string Filename
 17        {
 918            get { return Encoding.GetString(_fileName, 0, _fileName.Length); }
 51319            private set { _fileName = Encoding.GetBytes(value); }
 20        }
 21
 34822        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
 16533            {
 16534                var capacity = base.BufferCapacity;
 16535                capacity += 4; // FileName length
 16536                capacity += _fileName.Length; // FileName
 16537                return capacity;
 16538            }
 39        }
 40
 41        public SftpRemoveRequest(uint protocolVersion, uint requestId, string filename, Encoding encoding, Action<SftpSt
 17142            : base(protocolVersion, requestId, statusAction)
 17143        {
 17144            Encoding = encoding;
 17145            Filename = filename;
 17146        }
 47
 48        protected override void LoadData()
 049        {
 050            base.LoadData();
 051            _fileName = ReadBinary();
 052        }
 53
 54        protected override void SaveData()
 16555        {
 16556            base.SaveData();
 16557            WriteBinaryString(_fileName);
 16558        }
 59    }
 60}