< Summary

Class:Azure.Iot.Hub.Service.Models.ServiceStatistics
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ServiceStatistics.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ServiceStatistics.Serialization.cs
Covered lines:9
Uncovered lines:2
Coverable lines:11
Total lines:57
Line coverage:81.8% (9 of 11)
Covered branches:4
Total branches:4
Branch coverage:100% (4 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_ConnectedDeviceCount()-100%100%
DeserializeServiceStatistics(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ServiceStatistics.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 ServiceStatistics. </summary>
 11    public partial class ServiceStatistics
 12    {
 13        /// <summary> Initializes a new instance of ServiceStatistics. </summary>
 014        internal ServiceStatistics()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ServiceStatistics. </summary>
 19        /// <param name="connectedDeviceCount"> The number of currently connected devices. </param>
 420        internal ServiceStatistics(long? connectedDeviceCount)
 21        {
 422            ConnectedDeviceCount = connectedDeviceCount;
 423        }
 24
 25        /// <summary> The number of currently connected devices. </summary>
 426        public long? ConnectedDeviceCount { get; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\ServiceStatistics.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 ServiceStatistics
 14    {
 15        internal static ServiceStatistics DeserializeServiceStatistics(JsonElement element)
 16        {
 417            Optional<long> connectedDeviceCount = default;
 1618            foreach (var property in element.EnumerateObject())
 19            {
 420                if (property.NameEquals("connectedDeviceCount"))
 21                {
 422                    connectedDeviceCount = property.Value.GetInt64();
 23                    continue;
 24                }
 25            }
 426            return new ServiceStatistics(Optional.ToNullable(connectedDeviceCount));
 27        }
 28    }
 29}