< Summary

Information
Class: Renci.SshNet.Messages.Authentication.RequestMessageKeyboardInteractive
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Authentication\RequestMessageKeyboardInteractive.cs
Line coverage
100%
Covered lines: 20
Uncovered lines: 0
Coverable lines: 20
Total lines: 62
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_Language()100%1100%
get_SubMethods()100%1100%
get_BufferCapacity()100%1100%
.ctor(...)100%1100%
SaveData()100%1100%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Authentication\RequestMessageKeyboardInteractive.cs

#LineLine coverage
 1using System;
 2
 3namespace Renci.SshNet.Messages.Authentication
 4{
 5    /// <summary>
 6    /// Represents "keyboard-interactive" SSH_MSG_USERAUTH_REQUEST message.
 7    /// </summary>
 8    internal sealed class RequestMessageKeyboardInteractive : RequestMessage
 9    {
 10        /// <summary>
 11        /// Gets message language.
 12        /// </summary>
 53513        public byte[] Language { get; private set; }
 14
 15        /// <summary>
 16        /// Gets authentication sub methods.
 17        /// </summary>
 53518        public byte[] SubMethods { get; private set; }
 19
 20        /// <summary>
 21        /// Gets the size of the message in bytes.
 22        /// </summary>
 23        /// <value>
 24        /// The size of the messages in bytes.
 25        /// </value>
 26        protected override int BufferCapacity
 27        {
 28            get
 329            {
 330                var capacity = base.BufferCapacity;
 331                capacity += 4; // Language length
 332                capacity += Language.Length; // Language
 333                capacity += 4; // SubMethods length
 334                capacity += SubMethods.Length; // SubMethods
 335                return capacity;
 336            }
 37        }
 38
 39        /// <summary>
 40        /// Initializes a new instance of the <see cref="RequestMessageKeyboardInteractive"/> class.
 41        /// </summary>
 42        /// <param name="serviceName">Name of the service.</param>
 43        /// <param name="username">Authentication username.</param>
 44        public RequestMessageKeyboardInteractive(ServiceName serviceName, string username)
 52945            : base(serviceName, username, "keyboard-interactive")
 52946        {
 52947            Language = Array.Empty<byte>();
 52948            SubMethods = Array.Empty<byte>();
 52949        }
 50
 51        /// <summary>
 52        /// Called when type specific data need to be saved.
 53        /// </summary>
 54        protected override void SaveData()
 355        {
 356            base.SaveData();
 57
 358            WriteBinaryString(Language);
 359            WriteBinaryString(SubMethods);
 360        }
 61    }
 62}