< Summary

Class:Azure.Storage.Sas.UserDelegationKeyProperties
Assembly:Azure.Storage.Files.DataLake
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\UserDelegationKeyProperties.cs
Covered lines:19
Uncovered lines:0
Coverable lines:19
Total lines:71
Line coverage:100% (19 of 19)
Covered branches:12
Total branches:12
Branch coverage:100% (12 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_ObjectId()-100%100%
get_TenantId()-100%100%
get_StartsOn()-100%100%
get_ExpiresOn()-100%100%
get_Service()-100%100%
get_Version()-100%100%
AppendProperties(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\UserDelegationKeyProperties.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.Globalization;
 6using System.Net;
 7using System.Text;
 8
 9namespace Azure.Storage.Sas
 10{
 11    /// <summary>
 12    /// Encapsulates the shared properties used by both
 13    /// BlobSasQueryParameters and DataLakeSasQueryParameters.
 14    /// </summary>
 15    internal class UserDelegationKeyProperties
 16    {
 17        // skoid
 111618        internal string ObjectId { get; set; }
 19
 20        // sktid
 111621        internal string TenantId { get; set; }
 22
 23        // skt
 111624        internal DateTimeOffset StartsOn { get; set; }
 25
 26        // ske
 111627        internal DateTimeOffset ExpiresOn { get; set; }
 28
 29        // sks
 111630        internal string Service { get; set; }
 31
 32        // skv
 110033        internal string Version { get; set; }
 34
 35        /// <summary>
 36        /// Builds up the UserDelegationKey portion of the SAS query parameter string.
 37        /// </summary>
 38        public void AppendProperties(StringBuilder stringBuilder)
 39        {
 64040            if (!string.IsNullOrWhiteSpace(ObjectId))
 41            {
 22442                stringBuilder.AppendQueryParameter(Constants.Sas.Parameters.KeyObjectId, ObjectId);
 43            }
 44
 64045            if (!string.IsNullOrWhiteSpace(TenantId))
 46            {
 22447                stringBuilder.AppendQueryParameter(Constants.Sas.Parameters.KeyTenantId, TenantId);
 48            }
 49
 64050            if (StartsOn != DateTimeOffset.MinValue)
 51            {
 22452                stringBuilder.AppendQueryParameter(Constants.Sas.Parameters.KeyStart, WebUtility.UrlEncode(StartsOn.ToSt
 53            }
 54
 64055            if (ExpiresOn != DateTimeOffset.MinValue)
 56            {
 22457                stringBuilder.AppendQueryParameter(Constants.Sas.Parameters.KeyExpiry, WebUtility.UrlEncode(ExpiresOn.To
 58            }
 59
 64060            if (!string.IsNullOrWhiteSpace(Service))
 61            {
 22462                stringBuilder.AppendQueryParameter(Constants.Sas.Parameters.KeyService, Service);
 63            }
 64
 64065            if (!string.IsNullOrWhiteSpace(Version))
 66            {
 22467                stringBuilder.AppendQueryParameter(Constants.Sas.Parameters.KeyVersion, Version);
 68            }
 64069        }
 70    }
 71}