< Summary

Information
Class: Renci.SshNet.Messages.Transport.DebugMessage
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\DebugMessage.cs
Line coverage
36%
Covered lines: 9
Uncovered lines: 16
Coverable lines: 25
Total lines: 81
Line coverage: 36%
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_IsAlwaysDisplay()100%1100%
get_Message()100%10%
get_Language()100%10%
get_BufferCapacity()100%10%
LoadData()100%1100%
SaveData()100%10%
Process(...)100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\DebugMessage.cs

#LineLine coverage
 1namespace Renci.SshNet.Messages.Transport
 2{
 3    /// <summary>
 4    /// Represents SSH_MSG_DEBUG message.
 5    /// </summary>
 6    [Message("SSH_MSG_DEBUG", 4)]
 7    public class DebugMessage : Message
 8    {
 9        private byte[] _message;
 10        private byte[] _language;
 11
 12        /// <summary>
 13        /// Gets a value indicating whether the message to be always displayed.
 14        /// </summary>
 15        /// <value>
 16        /// <see langword="true"/> if the message always to be displayed; otherwise, <see langword="false"/>.
 17        /// </value>
 128018        public bool IsAlwaysDisplay { get; private set; }
 19
 20        /// <summary>
 21        /// Gets debug message.
 22        /// </summary>
 23        public string Message
 24        {
 025            get { return Utf8.GetString(_message, 0, _message.Length); }
 26        }
 27
 28        /// <summary>
 29        /// Gets message language.
 30        /// </summary>
 31        public string Language
 32        {
 033            get { return Utf8.GetString(_language, 0, _language.Length); }
 34        }
 35
 36        /// <summary>
 37        /// Gets the size of the message in bytes.
 38        /// </summary>
 39        /// <value>
 40        /// The size of the messages in bytes.
 41        /// </value>
 42        protected override int BufferCapacity
 43        {
 44            get
 045            {
 046                var capacity = base.BufferCapacity;
 047                capacity += 1; // IsAlwaysDisplay
 048                capacity += 4; // Message length
 049                capacity += _message.Length; // Message
 050                capacity += 4; // Language length
 051                capacity += _language.Length; // Language
 052                return capacity;
 053            }
 54        }
 55
 56        /// <summary>
 57        /// Called when type specific data need to be loaded.
 58        /// </summary>
 59        protected override void LoadData()
 128060        {
 128061            IsAlwaysDisplay = ReadBoolean();
 128062            _message = ReadBinary();
 128063            _language = ReadBinary();
 128064        }
 65
 66        /// <summary>
 67        /// Called when type specific data need to be saved.
 68        /// </summary>
 69        protected override void SaveData()
 070        {
 071            Write(IsAlwaysDisplay);
 072            WriteBinaryString(_message);
 073            WriteBinaryString(_language);
 074        }
 75
 76        internal override void Process(Session session)
 128077        {
 128078            session.OnDebugReceived(this);
 128079        }
 80    }
 81}