< Summary

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

File(s)

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

#LineLine coverage
 1namespace Renci.SshNet.Messages.Connection
 2{
 3    /// <summary>
 4    /// Represents "xon-xoff" type channel request information.
 5    /// </summary>
 6    internal sealed class XonXoffRequestInfo : RequestInfo
 7    {
 8        /// <summary>
 9        /// Channel request type.
 10        /// </summary>
 11        public const string Name = "xon-xoff";
 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 or sets a value indicating whether client can do.
 26        /// </summary>
 27        /// <value>
 28        /// <see langword="true"/> if client can do; otherwise, <see langword="false"/>.
 29        /// </value>
 030        public bool ClientCanDo { get; set; }
 31
 32        /// <summary>
 33        /// Gets the size of the message in bytes.
 34        /// </summary>
 35        /// <value>
 36        /// The size of the messages in bytes.
 37        /// </value>
 38        protected override int BufferCapacity
 39        {
 40            get
 041            {
 042                var capacity = base.BufferCapacity;
 043                capacity += 1; // ClientCanDo
 044                return capacity;
 045            }
 46        }
 47
 48        /// <summary>
 49        /// Initializes a new instance of the <see cref="XonXoffRequestInfo"/> class.
 50        /// </summary>
 280451        public XonXoffRequestInfo()
 280452        {
 280453            WantReply = false;
 280454        }
 55
 56        /// <summary>
 57        /// Initializes a new instance of the <see cref="XonXoffRequestInfo"/> class.
 58        /// </summary>
 59        /// <param name="clientCanDo">if set to <see langword="true"/> [client can do].</param>
 60        public XonXoffRequestInfo(bool clientCanDo)
 061            : this()
 062        {
 063            ClientCanDo = clientCanDo;
 064        }
 65
 66        /// <summary>
 67        /// Called when type specific data need to be loaded.
 68        /// </summary>
 69        protected override void LoadData()
 070        {
 071            base.LoadData();
 72
 073            ClientCanDo = ReadBoolean();
 074        }
 75
 76        /// <summary>
 77        /// Called when type specific data need to be saved.
 78        /// </summary>
 79        protected override void SaveData()
 080        {
 081            base.SaveData();
 82
 083            Write(ClientCanDo);
 084        }
 85    }
 86}