< Summary

Class:Azure.Storage.Cryptography.Models.ClientSideEncryptionVersionExtensions
Assembly:Azure.Storage.Blobs
File(s):C:\Git\azure-sdk-for-net\sdk\storage\Azure.Storage.Common\src\Shared\ClientsideEncryption\ClientSideEncryptionVersionExtensions.cs
Covered lines:0
Uncovered lines:4
Coverable lines:4
Total lines:37
Line coverage:0% (0 of 4)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
Serialize(...)-0%0%
ToClientSideEncryptionVersion(...)-0%0%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4namespace Azure.Storage.Cryptography.Models
 5{
 6    internal static class ClientSideEncryptionVersionExtensions
 7    {
 8        public static class ClientSideEncryptionVersionString
 9        {
 10            public const string V1_0 = "1.0";
 11        }
 12
 13        public static string Serialize(this ClientSideEncryptionVersion version)
 14        {
 15            switch (version)
 16            {
 17                case ClientSideEncryptionVersion.V1_0:
 018                    return ClientSideEncryptionVersionString.V1_0;
 19                default:
 20                    // sanity check; serialize is in this file to make it easy to add the serialization cases
 021                    throw Errors.ClientSideEncryption.ClientSideEncryptionVersionNotSupported();
 22            }
 23        }
 24
 25        public static ClientSideEncryptionVersion ToClientSideEncryptionVersion(this string versionString)
 26        {
 27            switch (versionString)
 28            {
 29                case ClientSideEncryptionVersionString.V1_0:
 030                    return ClientSideEncryptionVersion.V1_0;
 31                default:
 32                    // This library doesn't support the stated encryption version
 033                    throw Errors.ClientSideEncryption.ClientSideEncryptionVersionNotSupported(versionString);
 34            }
 35        }
 36    }
 37}