< Summary

Information
Class: Renci.SshNet.Sftp.Requests.HardLinkRequest
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\ExtendedRequests\HardLinkRequest.cs
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 57
Line coverage: 100%
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_OldPath()100%1100%
set_OldPath(...)100%1100%
get_NewPath()100%1100%
set_NewPath(...)100%1100%
get_BufferCapacity()100%1100%
.ctor(...)100%1100%
SaveData()100%1100%

File(s)

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

#LineLine coverage
 1using System;
 2
 3using Renci.SshNet.Sftp.Responses;
 4
 5namespace Renci.SshNet.Sftp.Requests
 6{
 7    internal sealed class HardLinkRequest : SftpExtendedRequest
 8    {
 9        private byte[] _oldPath;
 10        private byte[] _newPath;
 11
 12        public string OldPath
 13        {
 914            get { return Utf8.GetString(_oldPath, 0, _oldPath.Length); }
 2715            private set { _oldPath = Utf8.GetBytes(value); }
 16        }
 17
 18        public string NewPath
 19        {
 920            get { return Utf8.GetString(_newPath, 0, _newPath.Length); }
 2721            private set { _newPath = Utf8.GetBytes(value); }
 22        }
 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
 333            {
 334                var capacity = base.BufferCapacity;
 335                capacity += 4; // OldPath length
 336                capacity += _oldPath.Length; // OldPath
 337                capacity += 4; // NewPath length
 338                capacity += _newPath.Length; // NewPath
 339                return capacity;
 340            }
 41        }
 42
 43        public HardLinkRequest(uint protocolVersion, uint requestId, string oldPath, string newPath, Action<SftpStatusRe
 944            : base(protocolVersion, requestId, statusAction, "hardlink@openssh.com")
 945        {
 946            OldPath = oldPath;
 947            NewPath = newPath;
 948        }
 49
 50        protected override void SaveData()
 351        {
 352            base.SaveData();
 353            WriteBinaryString(_oldPath);
 354            WriteBinaryString(_newPath);
 355        }
 56    }
 57}