< Summary

Class:Azure.Iot.Hub.Service.Models.PropertyContainer
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\PropertyContainer.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\PropertyContainer.Serialization.cs
Covered lines:17
Uncovered lines:6
Coverable lines:23
Total lines:71
Line coverage:73.9% (17 of 23)
Covered branches:5
Total branches:8
Branch coverage:62.5% (5 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
get_Desired()-100%100%
get_Reported()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-64.71%62.5%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\PropertyContainer.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 Azure.Core;
 10
 11namespace Azure.Iot.Hub.Service.Models
 12{
 13    /// <summary> The desired and reported properties of the twin. The maximum depth of the object is 10. </summary>
 14    public partial class PropertyContainer
 15    {
 16        /// <summary> Initializes a new instance of PropertyContainer. </summary>
 8017        public PropertyContainer()
 18        {
 8019            Desired = new ChangeTrackingDictionary<string, object>();
 8020            Reported = new ChangeTrackingDictionary<string, object>();
 8021        }
 22
 23        /// <summary> The collection of desired property key-value pairs. The keys are UTF-8 encoded, case-sensitive and
 24024        public IDictionary<string, object> Desired { get; }
 25        /// <summary> The collection of reported property key-value pairs. The keys are UTF-8 encoded, case-sensitive an
 8026        public IDictionary<string, object> Reported { get; }
 27    }
 28}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\PropertyContainer.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 PropertyContainer : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 8017            writer.WriteStartObject();
 8018            if (Optional.IsCollectionDefined(Desired))
 19            {
 8020                writer.WritePropertyName("desired");
 8021                writer.WriteStartObject();
 32022                foreach (var item in Desired)
 23                {
 8024                    writer.WritePropertyName(item.Key);
 8025                    writer.WriteObjectValue(item.Value);
 26                }
 8027                writer.WriteEndObject();
 28            }
 8029            if (Optional.IsCollectionDefined(Reported))
 30            {
 031                writer.WritePropertyName("reported");
 032                writer.WriteStartObject();
 033                foreach (var item in Reported)
 34                {
 035                    writer.WritePropertyName(item.Key);
 036                    writer.WriteObjectValue(item.Value);
 37                }
 038                writer.WriteEndObject();
 39            }
 8040            writer.WriteEndObject();
 8041        }
 42    }
 43}