< Summary

Class:Azure.Security.KeyVault.Keys.KeyBackup
Assembly:Azure.Security.KeyVault.Keys
File(s):C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\KeyBackup.cs
Covered lines:7
Uncovered lines:0
Coverable lines:7
Total lines:28
Line coverage:100% (7 of 7)
Covered branches:2
Total branches:2
Branch coverage:100% (2 of 2)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.cctor()-100%100%
get_Value()-100%100%
Azure.Security.KeyVault.IJsonDeserializable.ReadProperties(...)-100%100%
Azure.Security.KeyVault.IJsonSerializable.WriteProperties(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Keys\src\KeyBackup.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Text.Json;
 5
 6namespace Azure.Security.KeyVault.Keys
 7{
 8    internal class KeyBackup : IJsonDeserializable, IJsonSerializable
 9    {
 10        private const string ValuePropertyName = "value";
 211        private static readonly JsonEncodedText s_valuePropertyNameBytes = JsonEncodedText.Encode(ValuePropertyName);
 12
 1613        public byte[] Value { get; set; }
 14
 15        void IJsonDeserializable.ReadProperties(JsonElement json)
 16        {
 417            if (json.TryGetProperty(ValuePropertyName, out JsonElement value))
 18            {
 419                Value = Base64Url.Decode(value.GetString());
 20            }
 421        }
 22
 23        void IJsonSerializable.WriteProperties(Utf8JsonWriter json)
 24        {
 425            json.WriteString(s_valuePropertyNameBytes, Base64Url.Encode(Value));
 426        }
 27    }
 28}