< Summary

Information
Class: Renci.SshNet.Sftp.Requests.SftpBlockRequest
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Sftp\Requests\SftpBlockRequest.cs
Line coverage
80%
Covered lines: 28
Uncovered lines: 7
Coverable lines: 35
Total lines: 71
Line coverage: 80%
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_Handle()100%1100%
get_Offset()100%1100%
get_Length()100%1100%
get_LockMask()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\SftpBlockRequest.cs

#LineLine coverage
 1using System;
 2
 3using Renci.SshNet.Sftp.Responses;
 4
 5namespace Renci.SshNet.Sftp.Requests
 6{
 7    internal sealed class SftpBlockRequest : SftpRequest
 8    {
 9        public override SftpMessageTypes SftpMessageType
 10        {
 1811            get { return SftpMessageTypes.Block; }
 12        }
 13
 1814        public byte[] Handle { get; private set; }
 15
 1516        public ulong Offset { get; private set; }
 17
 1518        public ulong Length { get; private set; }
 19
 1520        public uint LockMask { get; private set; }
 21
 22        /// <summary>
 23        /// Gets the size of the message in bytes.
 24        /// </summary>
 25        /// <value>
 26        /// The size of the messages in bytes.
 27        /// </value>
 28        protected override int BufferCapacity
 29        {
 30            get
 331            {
 332                var capacity = base.BufferCapacity;
 333                capacity += 4; // Handle length
 334                capacity += Handle.Length; // Handle
 335                capacity += 8; // Offset
 336                capacity += 8; // Length
 337                capacity += 4; // LockMask
 338                return capacity;
 339            }
 40        }
 41
 42        public SftpBlockRequest(uint protocolVersion, uint requestId, byte[] handle, ulong offset, ulong length, uint lo
 943            : base(protocolVersion, requestId, statusAction)
 944        {
 945            Handle = handle;
 946            Offset = offset;
 947            Length = length;
 948            LockMask = lockMask;
 949        }
 50
 51        protected override void LoadData()
 052        {
 053            base.LoadData();
 54
 055            Handle = ReadBinary();
 056            Offset = ReadUInt64();
 057            Length = ReadUInt64();
 058            LockMask = ReadUInt32();
 059        }
 60
 61        protected override void SaveData()
 362        {
 363            base.SaveData();
 64
 365            WriteBinaryString(Handle);
 366            Write(Offset);
 367            Write(Length);
 368            Write(LockMask);
 369        }
 70    }
 71}