< Summary

Information
Class: Renci.SshNet.Sftp.Requests.SftpSymLinkRequest
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpSymLinkRequest.cs
Line coverage
83%
Covered lines: 25
Uncovered lines: 5
Coverable lines: 30
Total lines: 72
Line coverage: 83.3%
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_NewLinkPath()100%1100%
set_NewLinkPath(...)100%1100%
get_ExistingPath()100%1100%
set_ExistingPath(...)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\SftpSymLinkRequest.cs

#LineLine coverage
 1using System;
 2using System.Text;
 3using Renci.SshNet.Sftp.Responses;
 4
 5namespace Renci.SshNet.Sftp.Requests
 6{
 7    internal sealed class SftpSymLinkRequest : SftpRequest
 8    {
 9        private byte[] _newLinkPath;
 10        private byte[] _existingPath;
 11
 12        public override SftpMessageTypes SftpMessageType
 13        {
 1814            get { return SftpMessageTypes.SymLink; }
 15        }
 16
 17        public string NewLinkPath
 18        {
 919            get { return Encoding.GetString(_newLinkPath, 0, _newLinkPath.Length); }
 2720            private set { _newLinkPath = Encoding.GetBytes(value); }
 21        }
 22
 23        public string ExistingPath
 24        {
 925            get { return Encoding.GetString(_existingPath, 0, _existingPath.Length); }
 2726            private set { _existingPath = Encoding.GetBytes(value); }
 27        }
 28
 3629        public Encoding Encoding { get; set; }
 30
 31        /// <summary>
 32        /// Gets the size of the message in bytes.
 33        /// </summary>
 34        /// <value>
 35        /// The size of the messages in bytes.
 36        /// </value>
 37        protected override int BufferCapacity
 38        {
 39            get
 340            {
 341                var capacity = base.BufferCapacity;
 342                capacity += 4; // NewLinkPath length
 343                capacity += _newLinkPath.Length; // NewLinkPath
 344                capacity += 4; // ExistingPath length
 345                capacity += _existingPath.Length; // ExistingPath
 346                return capacity;
 347            }
 48        }
 49
 50        public SftpSymLinkRequest(uint protocolVersion, uint requestId, string newLinkPath, string existingPath, Encodin
 951            : base(protocolVersion, requestId, statusAction)
 952        {
 953            Encoding = encoding;
 954            NewLinkPath = newLinkPath;
 955            ExistingPath = existingPath;
 956        }
 57
 58        protected override void LoadData()
 059        {
 060            base.LoadData();
 061            _newLinkPath = ReadBinary();
 062            _existingPath = ReadBinary();
 063        }
 64
 65        protected override void SaveData()
 366        {
 367            base.SaveData();
 368            WriteBinaryString(_newLinkPath);
 369            WriteBinaryString(_existingPath);
 370        }
 71    }
 72}