< Summary

Class:Azure.Iot.Hub.Service.Models.BulkRegistryOperationResponse
Assembly:Azure.Iot.Hub.Service
File(s):C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\BulkRegistryOperationResponse.cs
C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\BulkRegistryOperationResponse.Serialization.cs
Covered lines:21
Uncovered lines:10
Coverable lines:31
Total lines:93
Line coverage:67.7% (21 of 31)
Covered branches:10
Total branches:12
Branch coverage:83.3% (10 of 12)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_IsSuccessful()-100%100%
get_Errors()-0%100%
get_Warnings()-0%100%
DeserializeBulkRegistryOperationResponse(...)-78.95%83.33%

File(s)

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\BulkRegistryOperationResponse.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 result of the bulk registry operation. </summary>
 14    public partial class BulkRegistryOperationResponse
 15    {
 16        /// <summary> Initializes a new instance of BulkRegistryOperationResponse. </summary>
 017        internal BulkRegistryOperationResponse()
 18        {
 019            Errors = new ChangeTrackingList<DeviceRegistryOperationError>();
 020            Warnings = new ChangeTrackingList<DeviceRegistryOperationWarning>();
 021        }
 22
 23        /// <summary> Initializes a new instance of BulkRegistryOperationResponse. </summary>
 24        /// <param name="isSuccessful"> The operation result. </param>
 25        /// <param name="errors"> The device registry operation errors. </param>
 26        /// <param name="warnings"> The device registry operation warnings. </param>
 6027        internal BulkRegistryOperationResponse(bool? isSuccessful, IReadOnlyList<DeviceRegistryOperationError> errors, I
 28        {
 6029            IsSuccessful = isSuccessful;
 6030            Errors = errors;
 6031            Warnings = warnings;
 6032        }
 33
 34        /// <summary> The operation result. </summary>
 3635        public bool? IsSuccessful { get; }
 36        /// <summary> The device registry operation errors. </summary>
 037        public IReadOnlyList<DeviceRegistryOperationError> Errors { get; }
 38        /// <summary> The device registry operation warnings. </summary>
 039        public IReadOnlyList<DeviceRegistryOperationWarning> Warnings { get; }
 40    }
 41}

C:\Git\azure-sdk-for-net\sdk\iot\Azure.Iot.Hub.Service\src\Generated\Models\BulkRegistryOperationResponse.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.Iot.Hub.Service.Models
 13{
 14    public partial class BulkRegistryOperationResponse
 15    {
 16        internal static BulkRegistryOperationResponse DeserializeBulkRegistryOperationResponse(JsonElement element)
 17        {
 6018            Optional<bool> isSuccessful = default;
 6019            Optional<IReadOnlyList<DeviceRegistryOperationError>> errors = default;
 6020            Optional<IReadOnlyList<DeviceRegistryOperationWarning>> warnings = default;
 48021            foreach (var property in element.EnumerateObject())
 22            {
 18023                if (property.NameEquals("isSuccessful"))
 24                {
 6025                    isSuccessful = property.Value.GetBoolean();
 6026                    continue;
 27                }
 12028                if (property.NameEquals("errors"))
 29                {
 6030                    List<DeviceRegistryOperationError> array = new List<DeviceRegistryOperationError>();
 031                    foreach (var item in property.Value.EnumerateArray())
 32                    {
 033                        array.Add(DeviceRegistryOperationError.DeserializeDeviceRegistryOperationError(item));
 34                    }
 6035                    errors = array;
 6036                    continue;
 37                }
 6038                if (property.NameEquals("warnings"))
 39                {
 6040                    List<DeviceRegistryOperationWarning> array = new List<DeviceRegistryOperationWarning>();
 041                    foreach (var item in property.Value.EnumerateArray())
 42                    {
 043                        array.Add(DeviceRegistryOperationWarning.DeserializeDeviceRegistryOperationWarning(item));
 44                    }
 6045                    warnings = array;
 46                    continue;
 47                }
 48            }
 6049            return new BulkRegistryOperationResponse(Optional.ToNullable(isSuccessful), Optional.ToList(errors), Optiona
 50        }
 51    }
 52}