< Summary

Information
Class: Renci.SshNet.Messages.Connection.ChannelMessage
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Connection\ChannelMessage.cs
Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 77
Line coverage: 100%
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_LocalChannelNumber()100%1100%
get_BufferCapacity()100%1100%
.ctor()100%1100%
.ctor(...)100%1100%
LoadData()100%1100%
SaveData()100%1100%
ToString()100%1100%

File(s)

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

#LineLine coverage
 1using System.Globalization;
 2
 3namespace Renci.SshNet.Messages.Connection
 4{
 5    /// <summary>
 6    /// Base class for all channel specific SSH messages.
 7    /// </summary>
 8    public abstract class ChannelMessage : Message
 9    {
 10        /// <summary>
 11        /// Gets or sets the local channel number.
 12        /// </summary>
 13        /// <value>
 14        /// The local channel number.
 15        /// </value>
 27473016        public uint LocalChannelNumber { get; protected set; }
 17
 18        /// <summary>
 19        /// Gets the size of the message in bytes.
 20        /// </summary>
 21        /// <value>
 22        /// The size of the messages in bytes.
 23        /// </value>
 24        protected override int BufferCapacity
 25        {
 26            get
 4131027            {
 4131028                var capacity = base.BufferCapacity;
 4131029                capacity += 4; // LocalChannelNumber
 4131030                return capacity;
 4131031            }
 32        }
 33
 34        /// <summary>
 35        /// Initializes a new instance of the <see cref="ChannelMessage"/> class.
 36        /// </summary>
 4588337        protected ChannelMessage()
 4588338        {
 4588339        }
 40
 41        /// <summary>
 42        /// Initializes a new instance of the <see cref="ChannelMessage"/> class with the specified local channel number
 43        /// </summary>
 44        /// <param name="localChannelNumber">The local channel number.</param>
 4269545        protected ChannelMessage(uint localChannelNumber)
 4269546        {
 4269547            LocalChannelNumber = localChannelNumber;
 4269548        }
 49
 50        /// <summary>
 51        /// Called when type specific data need to be loaded.
 52        /// </summary>
 53        protected override void LoadData()
 4588054        {
 4588055            LocalChannelNumber = ReadUInt32();
 4588056        }
 57
 58        /// <summary>
 59        /// Called when type specific data need to be saved.
 60        /// </summary>
 61        protected override void SaveData()
 4131062        {
 4131063            Write(LocalChannelNumber);
 4131064        }
 65
 66        /// <summary>
 67        /// Returns a <see cref="string"/> that represents this instance.
 68        /// </summary>
 69        /// <returns>
 70        /// A <see cref="string"/> that represents this instance.
 71        /// </returns>
 72        public override string ToString()
 8718173        {
 8718174            return string.Format(CultureInfo.CurrentCulture, "{0} : #{1}", base.ToString(), LocalChannelNumber);
 8718175        }
 76    }
 77}