< Summary

Class:Azure.AI.FormRecognizer.Models.CopyResult
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyResult.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyResult.Serialization.cs
Covered lines:17
Uncovered lines:5
Coverable lines:22
Total lines:81
Line coverage:77.2% (17 of 22)
Covered branches:8
Total branches:8
Branch coverage:100% (8 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-100%100%
get_ModelId()-0%100%
get_Errors()-100%100%
DeserializeCopyResult(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyResult.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.Collections.Generic;
 10using Azure.Core;
 11
 12namespace Azure.AI.FormRecognizer.Models
 13{
 14    /// <summary> Custom model copy result. </summary>
 15    internal partial class CopyResult
 16    {
 17        /// <summary> Initializes a new instance of CopyResult. </summary>
 18        /// <param name="modelId"> Identifier of the target model. </param>
 019        internal CopyResult(Guid modelId)
 20        {
 021            ModelId = modelId;
 022            Errors = new ChangeTrackingList<FormRecognizerError>();
 023        }
 24
 25        /// <summary> Initializes a new instance of CopyResult. </summary>
 26        /// <param name="modelId"> Identifier of the target model. </param>
 27        /// <param name="errors"> Errors returned during the copy operation. </param>
 18228        internal CopyResult(Guid modelId, IReadOnlyList<FormRecognizerError> errors)
 29        {
 18230            ModelId = modelId;
 18231            Errors = errors;
 18232        }
 33
 34        /// <summary> Identifier of the target model. </summary>
 035        public Guid ModelId { get; }
 36        /// <summary> Errors returned during the copy operation. </summary>
 437        public IReadOnlyList<FormRecognizerError> Errors { get; }
 38    }
 39}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\CopyResult.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.Collections.Generic;
 10using System.Text.Json;
 11using Azure.Core;
 12
 13namespace Azure.AI.FormRecognizer.Models
 14{
 15    internal partial class CopyResult
 16    {
 17        internal static CopyResult DeserializeCopyResult(JsonElement element)
 18        {
 18219            Guid modelId = default;
 18220            Optional<IReadOnlyList<FormRecognizerError>> errors = default;
 73621            foreach (var property in element.EnumerateObject())
 22            {
 18623                if (property.NameEquals("modelId"))
 24                {
 18225                    modelId = property.Value.GetGuid();
 18226                    continue;
 27                }
 428                if (property.NameEquals("errors"))
 29                {
 430                    List<FormRecognizerError> array = new List<FormRecognizerError>();
 1631                    foreach (var item in property.Value.EnumerateArray())
 32                    {
 433                        array.Add(FormRecognizerError.DeserializeFormRecognizerError(item));
 34                    }
 435                    errors = array;
 36                    continue;
 37                }
 38            }
 18239            return new CopyResult(modelId, Optional.ToList(errors));
 40        }
 41    }
 42}