< Summary

Information
Class: Renci.SshNet.Messages.Connection.SignalRequestInfo
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelRequest\SignalRequestInfo.cs
Line coverage
96%
Covered lines: 24
Uncovered lines: 1
Coverable lines: 25
Total lines: 93
Line coverage: 96%
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%1100%
get_SignalName()100%10%
set_SignalName(...)100%1100%
get_BufferCapacity()100%1100%
.ctor()100%1100%
.ctor(...)100%1100%
LoadData()100%1100%
SaveData()100%1100%

File(s)

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

#LineLine coverage
 1namespace Renci.SshNet.Messages.Connection
 2{
 3    /// <summary>
 4    /// Represents "signal" type channel request information.
 5    /// </summary>
 6    internal sealed class SignalRequestInfo : RequestInfo
 7    {
 8        private byte[] _signalName;
 9
 10        /// <summary>
 11        /// Channel request name.
 12        /// </summary>
 13        public const string Name = "signal";
 14
 15        /// <summary>
 16        /// Gets the name of the request.
 17        /// </summary>
 18        /// <value>
 19        /// The name of the request.
 20        /// </value>
 21        public override string RequestName
 22        {
 1823            get { return Name; }
 24        }
 25
 26        /// <summary>
 27        /// Gets the name of the signal.
 28        /// </summary>
 29        /// <value>
 30        /// The name of the signal.
 31        /// </value>
 32        public string SignalName
 33        {
 034            get { return Ascii.GetString(_signalName, 0, _signalName.Length); }
 1835            private set { _signalName = Ascii.GetBytes(value); }
 36        }
 37
 38        /// <summary>
 39        /// Gets the size of the message in bytes.
 40        /// </summary>
 41        /// <value>
 42        /// The size of the messages in bytes.
 43        /// </value>
 44        protected override int BufferCapacity
 45        {
 46            get
 647            {
 648                var capacity = base.BufferCapacity;
 649                capacity += 4; // SignalName length
 650                capacity += _signalName.Length; // SignalName
 651                return capacity;
 652            }
 53        }
 54
 55        /// <summary>
 56        /// Initializes a new instance of the <see cref="SignalRequestInfo"/> class.
 57        /// </summary>
 281058        public SignalRequestInfo()
 281059        {
 281060            WantReply = false;
 281061        }
 62
 63        /// <summary>
 64        /// Initializes a new instance of the <see cref="SignalRequestInfo"/> class.
 65        /// </summary>
 66        /// <param name="signalName">Name of the signal.</param>
 67        public SignalRequestInfo(string signalName)
 668            : this()
 669        {
 670            SignalName = signalName;
 671        }
 72
 73        /// <summary>
 74        /// Called when type specific data need to be loaded.
 75        /// </summary>
 76        protected override void LoadData()
 677        {
 678            base.LoadData();
 79
 680            _signalName = ReadBinary();
 681        }
 82
 83        /// <summary>
 84        /// Called when type specific data need to be saved.
 85        /// </summary>
 86        protected override void SaveData()
 687        {
 688            base.SaveData();
 89
 690            WriteBinaryString(_signalName);
 691        }
 92    }
 93}