< Summary

Class:Azure.Iot.Hub.Service.Models.X509Thumbprint
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\X509Thumbprint.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\X509Thumbprint.Serialization.cs
Covered lines:20
Uncovered lines:6
Coverable lines:26
Total lines:83
Line coverage:76.9% (20 of 26)
Covered branches:8
Total branches:10
Branch coverage:80% (8 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_PrimaryThumbprint()-100%100%
get_SecondaryThumbprint()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-55.56%50%
DeserializeX509Thumbprint(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\X509Thumbprint.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8namespace Azure.Iot.Hub.Service.Models
 9{
 10    /// <summary> The X509Thumbprint. </summary>
 11    public partial class X509Thumbprint
 12    {
 13        /// <summary> Initializes a new instance of X509Thumbprint. </summary>
 014        public X509Thumbprint()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of X509Thumbprint. </summary>
 19        /// <param name="primaryThumbprint"> The X509 client certificate primary thumbprint. </param>
 20        /// <param name="secondaryThumbprint"> The X509 client certificate secondary thumbprint. </param>
 48221        internal X509Thumbprint(string primaryThumbprint, string secondaryThumbprint)
 22        {
 48223            PrimaryThumbprint = primaryThumbprint;
 48224            SecondaryThumbprint = secondaryThumbprint;
 48225        }
 26
 27        /// <summary> The X509 client certificate primary thumbprint. </summary>
 53828        public string PrimaryThumbprint { get; set; }
 29        /// <summary> The X509 client certificate secondary thumbprint. </summary>
 53830        public string SecondaryThumbprint { get; set; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\X509Thumbprint.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Iot.Hub.Service.Models
 12{
 13    public partial class X509Thumbprint : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 5617            writer.WriteStartObject();
 5618            if (Optional.IsDefined(PrimaryThumbprint))
 19            {
 020                writer.WritePropertyName("primaryThumbprint");
 021                writer.WriteStringValue(PrimaryThumbprint);
 22            }
 5623            if (Optional.IsDefined(SecondaryThumbprint))
 24            {
 025                writer.WritePropertyName("secondaryThumbprint");
 026                writer.WriteStringValue(SecondaryThumbprint);
 27            }
 5628            writer.WriteEndObject();
 5629        }
 30
 31        internal static X509Thumbprint DeserializeX509Thumbprint(JsonElement element)
 32        {
 48233            Optional<string> primaryThumbprint = default;
 48234            Optional<string> secondaryThumbprint = default;
 289235            foreach (var property in element.EnumerateObject())
 36            {
 96437                if (property.NameEquals("primaryThumbprint"))
 38                {
 48239                    primaryThumbprint = property.Value.GetString();
 48240                    continue;
 41                }
 48242                if (property.NameEquals("secondaryThumbprint"))
 43                {
 48244                    secondaryThumbprint = property.Value.GetString();
 45                    continue;
 46                }
 47            }
 48248            return new X509Thumbprint(primaryThumbprint.Value, secondaryThumbprint.Value);
 49        }
 50    }
 51}