< Summary

Information
Class: Renci.SshNet.Messages.Transport.IgnoreMessage
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Transport\IgnoreMessage.cs
Line coverage
100%
Covered lines: 26
Uncovered lines: 0
Coverable lines: 26
Total lines: 79
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_Data()100%1100%
.ctor()100%1100%
.ctor(...)100%2100%
get_BufferCapacity()100%1100%
LoadData()100%1100%
SaveData()100%1100%
Process(...)100%1100%

File(s)

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

#LineLine coverage
 1using System;
 2
 3namespace Renci.SshNet.Messages.Transport
 4{
 5    /// <summary>
 6    /// Represents SSH_MSG_IGNORE message.
 7    /// </summary>
 8    [Message("SSH_MSG_IGNORE", MessageNumber)]
 9    public class IgnoreMessage : Message
 10    {
 11        internal const byte MessageNumber = 2;
 12
 13        /// <summary>
 14        /// Gets ignore message data if this message has been initialised
 15        /// with data to be sent. Otherwise, returns an empty array.
 16        /// </summary>
 33217        public byte[] Data { get; private set; }
 18
 19        /// <summary>
 20        /// Initializes a new instance of the <see cref="IgnoreMessage"/> class.
 21        /// </summary>
 18822        public IgnoreMessage()
 18823        {
 18824            Data = Array.Empty<byte>();
 18825        }
 26
 27        /// <summary>
 28        /// Initializes a new instance of the <see cref="IgnoreMessage"/> class.
 29        /// </summary>
 30        /// <param name="data">The data.</param>
 7831        public IgnoreMessage(byte[] data)
 7832        {
 7833            if (data is null)
 334            {
 335                throw new ArgumentNullException(nameof(data));
 36            }
 37
 7538            Data = data;
 7539        }
 40
 41        /// <summary>
 42        /// Gets the size of the message in bytes.
 43        /// </summary>
 44        /// <value>
 45        /// The size of the messages in bytes.
 46        /// </value>
 47        protected override int BufferCapacity
 48        {
 49            get
 2750            {
 2751                var capacity = base.BufferCapacity;
 2752                capacity += 4; // Data length
 2753                capacity += Data.Length; // Data
 2754                return capacity;
 2755            }
 56        }
 57
 58        /// <summary>
 59        /// Called when type specific data need to be loaded.
 60        /// </summary>
 61        protected override void LoadData()
 462        {
 63            // Do nothing - this data is supposed to be ignored.
 464        }
 65
 66        /// <summary>
 67        /// Called when type specific data need to be saved.
 68        /// </summary>
 69        protected override void SaveData()
 2770        {
 2771            WriteBinaryString(Data);
 2772        }
 73
 74        internal override void Process(Session session)
 175        {
 176            session.OnIgnoreReceived(this);
 177        }
 78    }
 79}