< Summary

Class:Azure.Iot.Hub.Service.Models.DevicesStatistics
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DevicesStatistics.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DevicesStatistics.Serialization.cs
Covered lines:21
Uncovered lines:2
Coverable lines:23
Total lines:77
Line coverage:91.3% (21 of 23)
Covered branches:8
Total branches:8
Branch coverage:100% (8 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_TotalDeviceCount()-100%100%
get_EnabledDeviceCount()-100%100%
get_DisabledDeviceCount()-100%100%
DeserializeDevicesStatistics(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DevicesStatistics.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 RegistryStatistics. </summary>
 11    public partial class DevicesStatistics
 12    {
 13        /// <summary> Initializes a new instance of DevicesStatistics. </summary>
 014        internal DevicesStatistics()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DevicesStatistics. </summary>
 19        /// <param name="totalDeviceCount"> The total number of devices registered for the IoT Hub. </param>
 20        /// <param name="enabledDeviceCount"> The number of currently enabled devices. </param>
 21        /// <param name="disabledDeviceCount"> The number of currently disabled devices. </param>
 422        internal DevicesStatistics(long? totalDeviceCount, long? enabledDeviceCount, long? disabledDeviceCount)
 23        {
 424            TotalDeviceCount = totalDeviceCount;
 425            EnabledDeviceCount = enabledDeviceCount;
 426            DisabledDeviceCount = disabledDeviceCount;
 427        }
 28
 29        /// <summary> The total number of devices registered for the IoT Hub. </summary>
 430        public long? TotalDeviceCount { get; }
 31        /// <summary> The number of currently enabled devices. </summary>
 432        public long? EnabledDeviceCount { get; }
 33        /// <summary> The number of currently disabled devices. </summary>
 434        public long? DisabledDeviceCount { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DevicesStatistics.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 DevicesStatistics
 14    {
 15        internal static DevicesStatistics DeserializeDevicesStatistics(JsonElement element)
 16        {
 417            Optional<long> totalDeviceCount = default;
 418            Optional<long> enabledDeviceCount = default;
 419            Optional<long> disabledDeviceCount = default;
 3220            foreach (var property in element.EnumerateObject())
 21            {
 1222                if (property.NameEquals("totalDeviceCount"))
 23                {
 424                    totalDeviceCount = property.Value.GetInt64();
 425                    continue;
 26                }
 827                if (property.NameEquals("enabledDeviceCount"))
 28                {
 429                    enabledDeviceCount = property.Value.GetInt64();
 430                    continue;
 31                }
 432                if (property.NameEquals("disabledDeviceCount"))
 33                {
 434                    disabledDeviceCount = property.Value.GetInt64();
 35                    continue;
 36                }
 37            }
 438            return new DevicesStatistics(Optional.ToNullable(totalDeviceCount), Optional.ToNullable(enabledDeviceCount),
 39        }
 40    }
 41}