< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.cctor()-100%100%
.ctor(...)-100%100%
get_Properties()-100%100%
Azure.Security.KeyVault.IJsonSerializable.WriteProperties(...)-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using System.Text.Json;
 6
 7namespace Azure.Security.KeyVault.Certificates
 8{
 9    internal class CertificateUpdateParameters : IJsonSerializable
 10    {
 11        private const string AttributesPropertyName = "attributes";
 12        private const string EnabledPropertyName = "enabled";
 13        private const string TagsPropertyName = "tags";
 14
 215        private static readonly JsonEncodedText s_attributesPropertyNameBytes = JsonEncodedText.Encode(AttributesPropert
 216        private static readonly JsonEncodedText s_enabledPropertyNameBytes = JsonEncodedText.Encode(EnabledPropertyName)
 217        private static readonly JsonEncodedText s_tagsPropertyNameBytes = JsonEncodedText.Encode(TagsPropertyName);
 18
 819        public CertificateUpdateParameters(CertificateProperties properties)
 20        {
 821            Properties = properties;
 822        }
 23
 3624        public CertificateProperties Properties { get; }
 25
 26        void IJsonSerializable.WriteProperties(Utf8JsonWriter json)
 27        {
 828            if (Properties.Enabled.HasValue)
 29            {
 830                json.WriteStartObject(s_attributesPropertyNameBytes);
 31
 832                json.WriteBoolean(s_enabledPropertyNameBytes, Properties.Enabled.Value);
 33
 834                json.WriteEndObject();
 35            }
 36
 837            if (Properties.HasTags && Properties.Tags.Count > 0)
 38            {
 439                json.WriteStartObject(s_tagsPropertyNameBytes);
 40
 1641                foreach (KeyValuePair<string, string> kvp in Properties.Tags)
 42                {
 443                    json.WriteString(kvp.Key, kvp.Value);
 44                }
 45
 446                json.WriteEndObject();
 47            }
 848        }
 49    }
 50}