< Summary

Class:Azure.Identity.AuthenticationRequiredException
Assembly:Azure.Identity
File(s):C:\Git\azure-sdk-for-net\sdk\identity\Azure.Identity\src\AuthenticationRequiredException.cs
Covered lines:4
Uncovered lines:2
Coverable lines:6
Total lines:42
Line coverage:66.6% (4 of 6)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_TokenRequestContext()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\identity\Azure.Identity\src\AuthenticationRequiredException.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using Azure.Core;
 6
 7namespace Azure.Identity
 8{
 9    /// <summary>
 10    /// An exception indicating that interactive authentication is required.
 11    /// </summary>
 12    internal class AuthenticationRequiredException : CredentialUnavailableException
 13    {
 14        /// <summary>
 15        /// Creates a new <see cref="AuthenticationRequiredException"/> with the specified message and context.
 16        /// </summary>
 17        /// <param name="message">The message describing the authentication failure.</param>
 18        /// <param name="context">The details of the authentication request.</param>
 19        public AuthenticationRequiredException(string message, TokenRequestContext context)
 020            : this(message, context, default)
 21        {
 22
 023        }
 24
 25        /// <summary>
 26        /// Creates a new <see cref="AuthenticationRequiredException"/> with the specified message, context and inner ex
 27        /// </summary>
 28        /// <param name="message">The message describing the authentication failure.</param>
 29        /// <param name="context">The details of the authentication request.</param>
 30        /// <param name="innerException">The exception underlying the authentication failure.</param>
 31        public AuthenticationRequiredException(string message, TokenRequestContext context, Exception innerException)
 832            : base(message, innerException)
 33        {
 834            TokenRequestContext = context;
 835        }
 36
 37        /// <summary>
 38        /// The details of the authentication request which resulted in the authentication failure.
 39        /// </summary>
 840        public TokenRequestContext TokenRequestContext { get; }
 41    }
 42}