< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.IotHubDeviceTelemetryEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceTelemetryEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceTelemetryEventData.Serialization.cs
Covered lines:21
Uncovered lines:2
Coverable lines:23
Total lines:80
Line coverage:91.3% (21 of 23)
Covered branches:12
Total branches:12
Branch coverage:100% (12 of 12)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceTelemetryEventData.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.Collections.Generic;
 9
 10namespace Azure.Messaging.EventGrid.SystemEvents
 11{
 12    /// <summary> Event data for Microsoft.Devices.DeviceTelemetry event. </summary>
 13    public partial class IotHubDeviceTelemetryEventData : DeviceTelemetryEventProperties
 14    {
 15        /// <summary> Initializes a new instance of IotHubDeviceTelemetryEventData. </summary>
 016        internal IotHubDeviceTelemetryEventData()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of IotHubDeviceTelemetryEventData. </summary>
 21        /// <param name="body"> The content of the message from the device. </param>
 22        /// <param name="properties"> Application properties are user-defined strings that can be added to the message. 
 23        /// <param name="systemProperties"> System properties help identify contents and source of the messages. </param
 224        internal IotHubDeviceTelemetryEventData(object body, IReadOnlyDictionary<string, string> properties, IReadOnlyDi
 25        {
 226        }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\IotHubDeviceTelemetryEventData.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Messaging.EventGrid.SystemEvents
 13{
 14    public partial class IotHubDeviceTelemetryEventData
 15    {
 16        internal static IotHubDeviceTelemetryEventData DeserializeIotHubDeviceTelemetryEventData(JsonElement element)
 17        {
 218            Optional<object> body = default;
 219            Optional<IReadOnlyDictionary<string, string>> properties = default;
 220            Optional<IReadOnlyDictionary<string, string>> systemProperties = default;
 1621            foreach (var property in element.EnumerateObject())
 22            {
 623                if (property.NameEquals("body"))
 24                {
 225                    body = property.Value.GetObject();
 226                    continue;
 27                }
 428                if (property.NameEquals("properties"))
 29                {
 230                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 831                    foreach (var property0 in property.Value.EnumerateObject())
 32                    {
 233                        dictionary.Add(property0.Name, property0.Value.GetString());
 34                    }
 235                    properties = dictionary;
 236                    continue;
 37                }
 238                if (property.NameEquals("systemProperties"))
 39                {
 240                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 1241                    foreach (var property0 in property.Value.EnumerateObject())
 42                    {
 443                        dictionary.Add(property0.Name, property0.Value.GetString());
 44                    }
 245                    systemProperties = dictionary;
 46                    continue;
 47                }
 48            }
 249            return new IotHubDeviceTelemetryEventData(body.Value, Optional.ToDictionary(properties), Optional.ToDictiona
 50        }
 51    }
 52}