< Summary

Information
Class: Renci.SshNet.Messages.Connection.BreakRequestInfo
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelRequest\BreakRequestInfo.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 23
Coverable lines: 23
Total lines: 83
Line coverage: 0%
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_RequestName()100%10%
get_BreakLength()100%10%
get_BufferCapacity()100%10%
.ctor()100%10%
.ctor(...)100%10%
LoadData()100%10%
SaveData()100%10%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelRequest\BreakRequestInfo.cs

#LineLine coverage
 1namespace Renci.SshNet.Messages.Connection
 2{
 3    /// <summary>
 4    /// Represents "break" type channel request information.
 5    /// </summary>
 6    internal sealed class BreakRequestInfo : RequestInfo
 7    {
 8        /// <summary>
 9        /// Channel request name.
 10        /// </summary>
 11        public const string Name = "break";
 12
 13        /// <summary>
 14        /// Gets the name of the request.
 15        /// </summary>
 16        /// <value>
 17        /// The name of the request.
 18        /// </value>
 19        public override string RequestName
 20        {
 021            get { return Name; }
 22        }
 23
 24        /// <summary>
 25        /// Gets break length in milliseconds.
 26        /// </summary>
 027        public uint BreakLength { get; private set; }
 28
 29        /// <summary>
 30        /// Gets the size of the message in bytes.
 31        /// </summary>
 32        /// <value>
 33        /// The size of the messages in bytes.
 34        /// </value>
 35        protected override int BufferCapacity
 36        {
 37            get
 038            {
 039                var capacity = base.BufferCapacity;
 040                capacity += 4; // BreakLength
 041                return capacity;
 042            }
 43        }
 44
 45        /// <summary>
 46        /// Initializes a new instance of the <see cref="BreakRequestInfo"/> class.
 47        /// </summary>
 048        public BreakRequestInfo()
 049        {
 050            WantReply = true;
 051        }
 52
 53        /// <summary>
 54        /// Initializes a new instance of the <see cref="BreakRequestInfo"/> class.
 55        /// </summary>
 56        /// <param name="breakLength">Length of the break.</param>
 57        public BreakRequestInfo(uint breakLength)
 058            : this()
 059        {
 060            BreakLength = breakLength;
 061        }
 62
 63        /// <summary>
 64        /// Called when type specific data need to be loaded.
 65        /// </summary>
 66        protected override void LoadData()
 067        {
 068            base.LoadData();
 69
 070            BreakLength = ReadUInt32();
 071        }
 72
 73        /// <summary>
 74        /// Called when type specific data need to be saved.
 75        /// </summary>
 76        protected override void SaveData()
 077        {
 078            base.SaveData();
 79
 080            Write(BreakLength);
 081        }
 82    }
 83}