< Summary

Information
Class: Renci.SshNet.Messages.Authentication.FailureMessage
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Messages\Authentication\FailureMessage.cs
Line coverage
85%
Covered lines: 17
Uncovered lines: 3
Coverable lines: 20
Total lines: 72
Line coverage: 85%
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_AllowedAuthentications()100%1100%
get_Message()100%1100%
get_PartialSuccess()100%1100%
LoadData()100%2100%
SaveData()100%10%
Process(...)100%1100%
ToString()100%1100%

File(s)

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

#LineLine coverage
 1using System;
 2
 3namespace Renci.SshNet.Messages.Authentication
 4{
 5    /// <summary>
 6    /// Represents SSH_MSG_USERAUTH_FAILURE message.
 7    /// </summary>
 8    [Message("SSH_MSG_USERAUTH_FAILURE", 51)]
 9    public class FailureMessage : Message
 10    {
 11        /// <summary>
 12        /// Gets or sets the allowed authentications if available.
 13        /// </summary>
 14        /// <value>
 15        /// The allowed authentications.
 16        /// </value>
 368417        public string[] AllowedAuthentications { get; set; }
 18
 19        /// <summary>
 20        /// Gets failure message.
 21        /// </summary>
 1522        public string Message { get; private set; }
 23
 24        /// <summary>
 25        /// Gets a value indicating whether authentication is partially successful.
 26        /// </summary>
 27        /// <value>
 28        /// <see langword="true"/> if partially successful; otherwise, <see langword="false"/>.
 29        /// </value>
 489230        public bool PartialSuccess { get; private set; }
 31
 32        /// <summary>
 33        /// Called when type specific data need to be loaded.
 34        /// </summary>
 35        protected override void LoadData()
 122336        {
 122337            AllowedAuthentications = ReadNamesList();
 122338            PartialSuccess = ReadBoolean();
 122339            if (PartialSuccess)
 1540            {
 41#if NET || NETSTANDARD2_1_OR_GREATER
 1542                Message = string.Join(',', AllowedAuthentications);
 43#else
 044                Message = string.Join(",", AllowedAuthentications);
 45#endif // NET || NETSTANDARD2_1_OR_GREATER
 1546            }
 122347        }
 48
 49        /// <summary>
 50        /// Called when type specific data need to be saved.
 51        /// </summary>
 52        protected override void SaveData()
 053        {
 54#pragma warning disable MA0025 // Implement the functionality instead of throwing NotImplementedException
 055            throw new NotImplementedException();
 56#pragma warning restore MA0025 // Implement the functionality instead of throwing NotImplementedException
 57        }
 58
 59        internal override void Process(Session session)
 122360        {
 122361            session.OnUserAuthenticationFailureReceived(this);
 122362        }
 63
 64        /// <inheritdoc/>
 65        public override string ToString()
 122366        {
 67#pragma warning disable MA0089 // Optimize string method usage
 122368            return $"SSH_MSG_USERAUTH_FAILURE {string.Join(",", AllowedAuthentications)} ({nameof(PartialSuccess)}:{Part
 69#pragma warning restore MA0089 // Optimize string method usage
 122370        }
 71    }
 72}