< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.DeviceTwinInfoProperties
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfoProperties.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfoProperties.Serialization.cs
Covered lines:13
Uncovered lines:4
Coverable lines:17
Total lines:67
Line coverage:76.4% (13 of 17)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Desired()-0%100%
get_Reported()-0%100%
DeserializeDeviceTwinInfoProperties(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfoProperties.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.Messaging.EventGrid.SystemEvents
 9{
 10    /// <summary> Properties JSON element. </summary>
 11    public partial class DeviceTwinInfoProperties
 12    {
 13        /// <summary> Initializes a new instance of DeviceTwinInfoProperties. </summary>
 014        internal DeviceTwinInfoProperties()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DeviceTwinInfoProperties. </summary>
 19        /// <param name="desired"> A portion of the properties that can be written only by the application back-end, and
 20        /// <param name="reported"> A portion of the properties that can be written only by the device, and read by the 
 421        internal DeviceTwinInfoProperties(DeviceTwinProperties desired, DeviceTwinProperties reported)
 22        {
 423            Desired = desired;
 424            Reported = reported;
 425        }
 26
 27        /// <summary> A portion of the properties that can be written only by the application back-end, and read by the 
 028        public DeviceTwinProperties Desired { get; }
 29        /// <summary> A portion of the properties that can be written only by the device, and read by the application ba
 030        public DeviceTwinProperties Reported { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\DeviceTwinInfoProperties.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.Messaging.EventGrid.SystemEvents
 12{
 13    public partial class DeviceTwinInfoProperties
 14    {
 15        internal static DeviceTwinInfoProperties DeserializeDeviceTwinInfoProperties(JsonElement element)
 16        {
 417            Optional<DeviceTwinProperties> desired = default;
 418            Optional<DeviceTwinProperties> reported = default;
 2419            foreach (var property in element.EnumerateObject())
 20            {
 821                if (property.NameEquals("desired"))
 22                {
 423                    desired = DeviceTwinProperties.DeserializeDeviceTwinProperties(property.Value);
 424                    continue;
 25                }
 426                if (property.NameEquals("reported"))
 27                {
 428                    reported = DeviceTwinProperties.DeserializeDeviceTwinProperties(property.Value);
 29                    continue;
 30                }
 31            }
 432            return new DeviceTwinInfoProperties(desired.Value, reported.Value);
 33        }
 34    }
 35}