< Summary

Information
Class: Renci.SshNet.Sftp.Requests.SftpFSetStatRequest
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpFSetStatRequest.cs
Line coverage
82%
Covered lines: 24
Uncovered lines: 5
Coverable lines: 29
Total lines: 69
Line coverage: 82.7%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
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_Attributes()100%1100%
get_AttributesBytes()100%2100%
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\SftpFSetStatRequest.cs

#LineLine coverage
 1using System;
 2using Renci.SshNet.Sftp.Responses;
 3
 4namespace Renci.SshNet.Sftp.Requests
 5{
 6    internal sealed class SftpFSetStatRequest : SftpRequest
 7    {
 8        private byte[] _attributesBytes;
 9
 10        public override SftpMessageTypes SftpMessageType
 11        {
 3012            get { return SftpMessageTypes.FSetStat; }
 13        }
 14
 3015        public byte[] Handle { get; private set; }
 16
 2017        private SftpFileAttributes Attributes { get; set; }
 18
 19        private byte[] AttributesBytes
 20        {
 21            get
 1422            {
 1423                _attributesBytes ??= Attributes.GetBytes();
 1424                return _attributesBytes;
 1425            }
 26        }
 27
 28        /// <summary>
 29        /// Gets the size of the message in bytes.
 30        /// </summary>
 31        /// <value>
 32        /// The size of the messages in bytes.
 33        /// </value>
 34        protected override int BufferCapacity
 35        {
 36            get
 737            {
 738                var capacity = base.BufferCapacity;
 739                capacity += 4; // Handle length
 740                capacity += Handle.Length; // Handle
 741                capacity += AttributesBytes.Length; // Attributes
 742                return capacity;
 743            }
 44        }
 45
 46        public SftpFSetStatRequest(uint protocolVersion, uint requestId, byte[] handle, SftpFileAttributes attributes, A
 1347            : base(protocolVersion, requestId, statusAction)
 1348        {
 1349            Handle = handle;
 1350            Attributes = attributes;
 1351        }
 52
 53        protected override void LoadData()
 054        {
 055            base.LoadData();
 56
 057            Handle = ReadBinary();
 058            Attributes = ReadAttributes();
 059        }
 60
 61        protected override void SaveData()
 762        {
 763            base.SaveData();
 64
 765            WriteBinaryString(Handle);
 766            Write(AttributesBytes);
 767        }
 68    }
 69}