< Summary

Class:Microsoft.Azure.KeyVault.WebKey.JsonWebKeyOperation
Assembly:Microsoft.Azure.KeyVault.WebKey
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault.WebKey\src\JsonWebKeyOperations.cs
Covered lines:2
Uncovered lines:4
Coverable lines:6
Total lines:35
Line coverage:33.3% (2 of 6)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_AllOperations()-100%100%
.cctor()-100%100%
IsValidOperation(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Microsoft.Azure.KeyVault.WebKey\src\JsonWebKeyOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License. See License.txt in the project root for
 3// license information.
 4//
 5
 6namespace Microsoft.Azure.KeyVault.WebKey
 7{
 8    /// <summary>
 9    /// Supported JsonWebKey operations
 10    /// </summary>
 11    public static class JsonWebKeyOperation
 12    {
 13        public const string Encrypt = "encrypt";
 14        public const string Decrypt = "decrypt";
 15        public const string Sign = "sign";
 16        public const string Verify = "verify";
 17        public const string Wrap = "wrapKey";
 18        public const string Unwrap = "unwrapKey";
 19
 20        /// <summary>
 21        /// All operations names.
 22        /// </summary>
 2423        public static string[] AllOperations => (string[]) _allOperations.Clone();
 24
 425        private static readonly string[] _allOperations = {Encrypt, Decrypt, Sign, Verify, Wrap, Unwrap};
 26
 27        public static bool IsValidOperation( string operation )
 28        {
 029            foreach ( var validOperation in _allOperations )
 030                if ( operation == validOperation )
 031                    return true;
 032            return false;
 33        }
 34    }
 35}