< Summary

Class:Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models.AnalyzeResults
Assembly:Microsoft.Azure.CognitiveServices.Vision.ComputerVision
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\AnalyzeResults.cs
Covered lines:0
Uncovered lines:17
Coverable lines:17
Total lines:90
Line coverage:0% (0 of 17)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Version()-0%100%
get_ReadResults()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Vision.ComputerVision\src\Generated\Models\AnalyzeResults.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.CognitiveServices.Vision.ComputerVision.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// Analyze batch operation result.
 21    /// </summary>
 22    public partial class AnalyzeResults
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the AnalyzeResults class.
 26        /// </summary>
 027        public AnalyzeResults()
 28        {
 29            CustomInit();
 030        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the AnalyzeResults class.
 34        /// </summary>
 35        /// <param name="version">Version of schema used for this
 36        /// result.</param>
 37        /// <param name="readResults">Text extracted from the input.</param>
 038        public AnalyzeResults(string version, IList<ReadResult> readResults)
 39        {
 040            Version = version;
 041            ReadResults = readResults;
 42            CustomInit();
 043        }
 44
 45        /// <summary>
 46        /// An initialization method that performs custom operations like setting defaults
 47        /// </summary>
 48        partial void CustomInit();
 49
 50        /// <summary>
 51        /// Gets or sets version of schema used for this result.
 52        /// </summary>
 53        [JsonProperty(PropertyName = "version")]
 054        public string Version { get; set; }
 55
 56        /// <summary>
 57        /// Gets or sets text extracted from the input.
 58        /// </summary>
 59        [JsonProperty(PropertyName = "readResults")]
 060        public IList<ReadResult> ReadResults { get; set; }
 61
 62        /// <summary>
 63        /// Validate the object.
 64        /// </summary>
 65        /// <exception cref="ValidationException">
 66        /// Thrown if validation fails
 67        /// </exception>
 68        public virtual void Validate()
 69        {
 070            if (Version == null)
 71            {
 072                throw new ValidationException(ValidationRules.CannotBeNull, "Version");
 73            }
 074            if (ReadResults == null)
 75            {
 076                throw new ValidationException(ValidationRules.CannotBeNull, "ReadResults");
 77            }
 078            if (ReadResults != null)
 79            {
 080                foreach (var element in ReadResults)
 81                {
 082                    if (element != null)
 83                    {
 084                        element.Validate();
 85                    }
 86                }
 87            }
 088        }
 89    }
 90}