< Summary

Class:Azure.AI.FormRecognizer.Models.TrainRequest
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\TrainRequest.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\TrainRequest.Serialization.cs
Covered lines:18
Uncovered lines:1
Coverable lines:19
Total lines:69
Line coverage:94.7% (18 of 19)
Covered branches:5
Total branches:6
Branch coverage:83.3% (5 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
get_Source()-100%100%
get_SourceFilter()-100%100%
get_UseLabelFile()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\TrainRequest.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 Azure.AI.FormRecognizer.Training;
 10
 11namespace Azure.AI.FormRecognizer.Models
 12{
 13    /// <summary> Request parameter to train a new custom model. </summary>
 14    internal partial class TrainRequest
 15    {
 16        /// <summary> Initializes a new instance of TrainRequest. </summary>
 17        /// <param name="source"> Source path containing the training documents. </param>
 18        /// <exception cref="ArgumentNullException"> <paramref name="source"/> is null. </exception>
 14819        public TrainRequest(string source)
 20        {
 14821            if (source == null)
 22            {
 023                throw new ArgumentNullException(nameof(source));
 24            }
 25
 14826            Source = source;
 14827        }
 28
 29        /// <summary> Source path containing the training documents. </summary>
 14830        public string Source { get; }
 31        /// <summary> Filter to apply to the documents in the source path for training. </summary>
 30432        public TrainingFileFilter SourceFilter { get; set; }
 33        /// <summary> Use label file for training a model. </summary>
 44434        public bool? UseLabelFile { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\TrainRequest.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.AI.FormRecognizer.Models
 12{
 13    internal partial class TrainRequest : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 14817            writer.WriteStartObject();
 14818            writer.WritePropertyName("source");
 14819            writer.WriteStringValue(Source);
 14820            if (Optional.IsDefined(SourceFilter))
 21            {
 822                writer.WritePropertyName("sourceFilter");
 823                writer.WriteObjectValue(SourceFilter);
 24            }
 14825            if (Optional.IsDefined(UseLabelFile))
 26            {
 14827                writer.WritePropertyName("useLabelFile");
 14828                writer.WriteBooleanValue(UseLabelFile.Value);
 29            }
 14830            writer.WriteEndObject();
 14831        }
 32    }
 33}