< Summary

Class:Azure.Iot.Hub.Service.Models.FaultInjectionProperties
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\FaultInjectionProperties.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\FaultInjectionProperties.Serialization.cs
Covered lines:0
Uncovered lines:35
Coverable lines:35
Total lines:101
Line coverage:0% (0 of 35)
Covered branches:0
Total branches:14
Branch coverage:0% (0 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_IotHubName()-0%100%
get_Connection()-0%100%
get_LastUpdatedTimeUtc()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeFaultInjectionProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\FaultInjectionProperties.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;
 9
 10namespace Azure.Iot.Hub.Service.Models
 11{
 12    /// <summary> The FaultInjectionProperties. </summary>
 13    internal partial class FaultInjectionProperties
 14    {
 15        /// <summary> Initializes a new instance of FaultInjectionProperties. </summary>
 016        public FaultInjectionProperties()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of FaultInjectionProperties. </summary>
 21        /// <param name="iotHubName"> The name of the Iot Hub. </param>
 22        /// <param name="connection"> The properties for the connection. </param>
 23        /// <param name="lastUpdatedTimeUtc"> The date and time the object was last updated. </param>
 024        internal FaultInjectionProperties(string iotHubName, FaultInjectionConnectionProperties connection, DateTimeOffs
 25        {
 026            IotHubName = iotHubName;
 027            Connection = connection;
 028            LastUpdatedTimeUtc = lastUpdatedTimeUtc;
 029        }
 30
 31        /// <summary> The name of the Iot Hub. </summary>
 032        public string IotHubName { get; set; }
 33        /// <summary> The properties for the connection. </summary>
 034        public FaultInjectionConnectionProperties Connection { get; set; }
 35        /// <summary> The date and time the object was last updated. </summary>
 036        public DateTimeOffset? LastUpdatedTimeUtc { get; set; }
 37    }
 38}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\FaultInjectionProperties.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;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Iot.Hub.Service.Models
 13{
 14    internal partial class FaultInjectionProperties : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(IotHubName))
 20            {
 021                writer.WritePropertyName("IotHubName");
 022                writer.WriteStringValue(IotHubName);
 23            }
 024            if (Optional.IsDefined(Connection))
 25            {
 026                writer.WritePropertyName("connection");
 027                writer.WriteObjectValue(Connection);
 28            }
 029            if (Optional.IsDefined(LastUpdatedTimeUtc))
 30            {
 031                writer.WritePropertyName("lastUpdatedTimeUtc");
 032                writer.WriteStringValue(LastUpdatedTimeUtc.Value, "O");
 33            }
 034            writer.WriteEndObject();
 035        }
 36
 37        internal static FaultInjectionProperties DeserializeFaultInjectionProperties(JsonElement element)
 38        {
 039            Optional<string> iotHubName = default;
 040            Optional<FaultInjectionConnectionProperties> connection = default;
 041            Optional<DateTimeOffset> lastUpdatedTimeUtc = default;
 042            foreach (var property in element.EnumerateObject())
 43            {
 044                if (property.NameEquals("IotHubName"))
 45                {
 046                    iotHubName = property.Value.GetString();
 047                    continue;
 48                }
 049                if (property.NameEquals("connection"))
 50                {
 051                    connection = FaultInjectionConnectionProperties.DeserializeFaultInjectionConnectionProperties(proper
 052                    continue;
 53                }
 054                if (property.NameEquals("lastUpdatedTimeUtc"))
 55                {
 056                    lastUpdatedTimeUtc = property.Value.GetDateTimeOffset("O");
 57                    continue;
 58                }
 59            }
 060            return new FaultInjectionProperties(iotHubName.Value, connection.Value, Optional.ToNullable(lastUpdatedTimeU
 61        }
 62    }
 63}