< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%100%
get_Policy()-100%100%
ReadProperty(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\keyvault\Azure.Security.KeyVault.Certificates\src\KeyVaultCertificateWithPolicy.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.Certificates
 7{
 8    /// <summary>
 9    /// A <see cref="KeyVaultCertificate"/> along with its <see cref="CertificatePolicy"/>.
 10    /// </summary>
 11    public class KeyVaultCertificateWithPolicy : KeyVaultCertificate
 12    {
 13        private const string PolicyPropertyName = "policy";
 14
 6015        internal KeyVaultCertificateWithPolicy(CertificateProperties properties = null) : base(properties)
 16        {
 6017        }
 18
 19        /// <summary>
 20        /// Gets the current policy for the certificate.
 21        /// </summary>
 12022        public CertificatePolicy Policy { get; internal set; }
 23
 24        internal override void ReadProperty(JsonProperty prop)
 25        {
 45626            switch (prop.Name)
 27            {
 28                case PolicyPropertyName:
 6029                    Policy = new CertificatePolicy();
 6030                    ((IJsonDeserializable)Policy).ReadProperties(prop.Value);
 6031                    break;
 32
 33                default:
 39634                    base.ReadProperty(prop);
 35                    break;
 36            }
 39637        }
 38    }
 39
 40}