< Summary

Class:Azure.Iot.Hub.Service.Models.DeviceCapabilities
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Customized\Models\DeviceCapabilities.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DeviceCapabilities.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DeviceCapabilities.Serialization.cs
Covered lines:15
Uncovered lines:2
Coverable lines:17
Total lines:78
Line coverage:88.2% (15 of 17)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_IsIotEdgeDevice()-100%100%
.ctor()-0%100%
.ctor(...)-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeDeviceCapabilities(...)-100%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using Azure.Core;
 5
 6namespace Azure.Iot.Hub.Service.Models
 7{
 8    public partial class DeviceCapabilities
 9    {
 10        [CodeGenMember("IotEdge")]
 36611        public bool? IsIotEdgeDevice { get; set; }
 12    }
 13}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DeviceCapabilities.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 status of capabilities enabled on the device. </summary>
 11    public partial class DeviceCapabilities
 12    {
 13        /// <summary> Initializes a new instance of DeviceCapabilities. </summary>
 014        public DeviceCapabilities()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DeviceCapabilities. </summary>
 19        /// <param name="isIotEdgeDevice"> The property that determines if the device is an edge device or not. </param>
 15520        internal DeviceCapabilities(bool? isIotEdgeDevice)
 21        {
 15522            IsIotEdgeDevice = isIotEdgeDevice;
 15523        }
 24    }
 25}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\DeviceCapabilities.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 DeviceCapabilities : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 2817            writer.WriteStartObject();
 2818            if (Optional.IsDefined(IsIotEdgeDevice))
 19            {
 2820                writer.WritePropertyName("iotEdge");
 2821                writer.WriteBooleanValue(IsIotEdgeDevice.Value);
 22            }
 2823            writer.WriteEndObject();
 2824        }
 25
 26        internal static DeviceCapabilities DeserializeDeviceCapabilities(JsonElement element)
 27        {
 31028            Optional<bool> iotEdge = default;
 124029            foreach (var property in element.EnumerateObject())
 30            {
 31031                if (property.NameEquals("iotEdge"))
 32                {
 31033                    iotEdge = property.Value.GetBoolean();
 34                    continue;
 35                }
 36            }
 31037            return new DeviceCapabilities(Optional.ToNullable(iotEdge));
 38        }
 39    }
 40}