< Summary

Class:Azure.Identity.DeviceCodeInfo
Assembly:Azure.Identity
File(s):C:\Git\azure-sdk-for-net\sdk\identity\Azure.Identity\src\DeviceCodeInfo.cs
Covered lines:9
Uncovered lines:6
Coverable lines:15
Total lines:62
Line coverage:60% (9 of 15)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_UserCode()-0%100%
get_DeviceCode()-0%100%
get_VerificationUri()-0%100%
get_ExpiresOn()-0%100%
get_Message()-100%100%
get_ClientId()-0%100%
get_Scopes()-0%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using Microsoft.Identity.Client;
 5using System;
 6using System.Collections.Generic;
 7using System.Text;
 8
 9namespace Azure.Identity
 10{
 11    /// <summary>
 12    /// Details of the device code to present to a user to allow them to authenticate through the device code authentica
 13    /// </summary>
 14    public struct DeviceCodeInfo
 15    {
 16        internal DeviceCodeInfo(DeviceCodeResult deviceCode)
 17        {
 2018            UserCode = deviceCode.UserCode;
 2019            DeviceCode = deviceCode.DeviceCode;
 2020            VerificationUri = new Uri(deviceCode.VerificationUrl);
 2021            ExpiresOn = deviceCode.ExpiresOn;
 2022            Message = deviceCode.Message;
 2023            ClientId = deviceCode.ClientId;
 2024            Scopes = deviceCode.Scopes;
 2025        }
 26
 27        /// <summary>
 28        /// User code returned by the service
 29        /// </summary>
 030        public string UserCode { get; private set; }
 31
 32        /// <summary>
 33        /// Device code returned by the service
 34        /// </summary>
 035        public string DeviceCode { get; private set; }
 36
 37        /// <summary>
 38        /// Verification URL where the user must navigate to authenticate using the device code and credentials.
 39        /// </summary>
 040        public Uri VerificationUri { get; private set; }
 41
 42        /// <summary>
 43        /// Time when the device code will expire.
 44        /// </summary>
 045        public DateTimeOffset ExpiresOn { get; private set; }
 46
 47        /// <summary>
 48        /// User friendly text response that can be used for display purpose.
 49        /// </summary>
 3250        public string Message { get; private set; }
 51
 52        /// <summary>
 53        /// Identifier of the client requesting device code.
 54        /// </summary>
 055        public string ClientId { get; private set; }
 56
 57        /// <summary>
 58        /// List of the scopes that would be held by token.
 59        /// </summary>
 060        public IReadOnlyCollection<string> Scopes { get; private set; }
 61    }
 62}