< Summary

Class:Microsoft.Azure.Batch.Auth.BatchSharedKeyCredentials
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Auth\BatchSharedKeyCredentials.cs
Covered lines:10
Uncovered lines:3
Coverable lines:13
Total lines:52
Line coverage:76.9% (10 of 13)
Covered branches:3
Total branches:6
Branch coverage:50% (3 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_AccountName()-100%100%
get_KeyValue()-100%100%
.ctor(...)-72.73%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\Auth\BatchSharedKeyCredentials.cs

#LineLine coverage
 1//
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for license information.
 4
 5//
 6
 7namespace Microsoft.Azure.Batch.Auth
 8{
 9    using System;
 10
 11    /// <summary>
 12    /// Shared key credentials for an Azure Batch account.
 13    /// </summary>
 14    public class BatchSharedKeyCredentials : BatchCredentials
 15    {
 16        /// <summary>
 17        /// Gets the Batch account name.
 18        /// </summary>
 29919        public string AccountName { get; private set; }
 20
 21        /// <summary>
 22        /// Gets the Base64 encoded account access key.
 23        /// </summary>
 29924        internal string KeyValue { get; private set; }
 25
 26        /// <summary>
 27        /// Initializes a new instance of the <see cref="BatchSharedKeyCredentials"/> class with the specified Batch ser
 28        /// </summary>
 29        /// <param name="baseUrl">The Batch service endpoint.</param>
 30        /// <param name="accountName">The name of the Batch account.</param>
 31        /// <param name="keyValue">The Base64 encoded account access key.</param>
 16132        public BatchSharedKeyCredentials(string baseUrl, string accountName, string keyValue)
 33        {
 16134            if (string.IsNullOrEmpty(baseUrl))
 35            {
 036                throw new ArgumentNullException("baseUrl");
 37            }
 16138            if (string.IsNullOrEmpty(accountName))
 39            {
 040                throw new ArgumentNullException("accountName");
 41            }
 16142            if (string.IsNullOrEmpty(keyValue))
 43            {
 044                throw new ArgumentNullException("keyValue");
 45            }
 46
 16147            this.BaseUrl = baseUrl;
 16148            this.AccountName = accountName;
 16149            this.KeyValue = keyValue;
 16150        }
 51    }
 52}