< Summary

Class:Microsoft.Azure.Batch.FileStaging.StagingStorageAccount
Assembly:Microsoft.Azure.Batch.FileStaging
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch.FileStaging\src\StagingStorageAccount.cs
Covered lines:13
Uncovered lines:8
Coverable lines:21
Total lines:96
Line coverage:61.9% (13 of 21)
Covered branches:5
Total branches:6
Branch coverage:83.3% (5 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_StorageAccount()-100%100%
set_StorageAccount(...)-100%100%
get_StorageAccountKey()-100%100%
set_StorageAccountKey(...)-100%100%
get_BlobEndpoint()-0%100%
set_BlobEndpoint(...)-0%100%
get_BlobUri()-0%100%
set_BlobUri(...)-0%100%
.ctor()-0%100%
.ctor(...)-81.82%83.33%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft and contributors.  All rights reserved.
 2//
 3// Licensed under the Apache License, Version 2.0 (the "License");
 4// you may not use this file except in compliance with the License.
 5// You may obtain a copy of the License at
 6// http://www.apache.org/licenses/LICENSE-2.0
 7//
 8// Unless required by applicable law or agreed to in writing, software
 9// distributed under the License is distributed on an "AS IS" BASIS,
 10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 11//
 12// See the License for the specific language governing permissions and
 13// limitations under the License.
 14
 15using System;
 16using System.Collections.Generic;
 17using System.Linq;
 18using System.Text;
 19using System.Threading.Tasks;
 20
 21namespace Microsoft.Azure.Batch.FileStaging
 22{
 23    /// <summary>
 24    /// Holds storage account information.
 25    /// </summary>
 26    public class StagingStorageAccount
 27    {
 28        /// <summary>
 29        /// Specifies the storage account to be used.
 30        /// </summary>
 31        public string StorageAccount
 32        {
 333            get;
 334            internal set;
 35        }
 36
 37        /// <summary>
 38        /// Specifies the storage account key to be used.
 39        /// </summary>
 40        public string StorageAccountKey
 41        {
 242            get;
 343            internal set;
 44        }
 45
 46        /// <summary>
 47        /// The serviced endpoint for blob storage.
 48        /// </summary>
 49        public string BlobEndpoint
 50        {
 051            get;
 052            internal set;
 53        }
 54
 55        // Constructed here to give immediate validation/failure experience.
 56        internal Uri BlobUri
 57        {
 058            get;
 059            set;
 60        }
 61
 062        private StagingStorageAccount()
 63        {
 064        }
 65
 66        /// <summary>
 67        /// Initializes a new instance of the StagingStorageAccount class using the specified credentials and service en
 68        /// </summary>
 69        /// <param name="storageAccount">A string specifying the storage account to be used.</param>
 70        /// <param name="storageAccountKey">A string specifying the storage account key to be used.</param>
 71        /// <param name="blobEndpoint">A string specifying the primary Blob service endpoint.</param>
 372        public StagingStorageAccount(string storageAccount, string storageAccountKey, string blobEndpoint)
 73        {
 374            this.StorageAccount = storageAccount;
 375            this.StorageAccountKey =  storageAccountKey;
 76
 377            if (string.IsNullOrWhiteSpace(this.StorageAccount))
 78            {
 179                throw new ArgumentOutOfRangeException("storageAccount");
 80            }
 81
 282            if (string.IsNullOrWhiteSpace(this.StorageAccountKey))
 83            {
 184                throw new ArgumentOutOfRangeException("storageAccountKey");
 85            }
 86
 187            if (string.IsNullOrWhiteSpace(blobEndpoint))
 88            {
 189                throw new ArgumentOutOfRangeException("blobEndpoint");
 90            }
 91
 92            // Constructed here to give immediate validation/failure experience.
 093            this.BlobUri = new Uri(blobEndpoint);
 094        }
 95    }
 96}