< Summary

Class:Azure.Storage.Cryptography.ClientSideEncryptionOptionsExtensions
Assembly:Azure.Storage.Queues
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\ClientsideEncryption\ClientSideEncryptionOptionsExtensions.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:40
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:0

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Clone(...)-0%100%
CopyOptions(...)-0%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4namespace Azure.Storage.Cryptography
 5{
 6    internal static class ClientSideEncryptionOptionsExtensions
 7    {
 8        /// <summary>
 9        /// Extension method to clone an instance of <see cref="ClientSideEncryptionOptions"/>.
 10        /// </summary>
 11        /// <param name="options"></param>
 12        /// <returns></returns>
 13        public static ClientSideEncryptionOptions Clone(this ClientSideEncryptionOptions options)
 14        {
 015            var newOptions = new ClientSideEncryptionOptions(options.EncryptionVersion);
 016            CopyOptions(options, newOptions);
 017            return newOptions;
 18        }
 19
 20        /// <summary>
 21        /// Copies all properties from one instance to another. It cannot copy
 22        /// <see cref="ClientSideEncryptionOptions.EncryptionVersion"/>;
 23        /// that is the responsibility of the caller who made the instance.
 24        /// </summary>
 25        /// <param name="source">Object to copy from.</param>
 26        /// <param name="destination">Object to copy to.</param>
 27        /// <remarks>
 28        /// This functionality has been pulled out to be accessible by other
 29        /// clone methods available on subclasses. They need the ability to
 30        /// instantiate the subclass destination first before copying over the
 31        /// properties.
 32        /// </remarks>
 33        internal static void CopyOptions(ClientSideEncryptionOptions source, ClientSideEncryptionOptions destination)
 34        {
 035            destination.KeyEncryptionKey = source.KeyEncryptionKey;
 036            destination.KeyResolver = source.KeyResolver;
 037            destination.KeyWrapAlgorithm = source.KeyWrapAlgorithm;
 038        }
 39    }
 40}

Methods/Properties

Clone(...)
CopyOptions(...)