< Summary

Class:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.PredictionResponse
Assembly:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Runtime\src\Generated\Models\PredictionResponse.cs
Covered lines:4
Uncovered lines:11
Coverable lines:15
Total lines:82
Line coverage:26.6% (4 of 15)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Query()-100%100%
get_Prediction()-100%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Runtime\src\Generated\Models\PredictionResponse.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.Language.LUIS.Runtime.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// Represents the prediction response.
 19    /// </summary>
 20    public partial class PredictionResponse
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the PredictionResponse class.
 24        /// </summary>
 425        public PredictionResponse()
 26        {
 27            CustomInit();
 428        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the PredictionResponse class.
 32        /// </summary>
 33        /// <param name="query">The query used in the prediction.</param>
 34        /// <param name="prediction">The prediction of the requested
 35        /// query.</param>
 036        public PredictionResponse(string query, Prediction prediction)
 37        {
 038            Query = query;
 039            Prediction = prediction;
 40            CustomInit();
 041        }
 42
 43        /// <summary>
 44        /// An initialization method that performs custom operations like setting defaults
 45        /// </summary>
 46        partial void CustomInit();
 47
 48        /// <summary>
 49        /// Gets or sets the query used in the prediction.
 50        /// </summary>
 51        [JsonProperty(PropertyName = "query")]
 852        public string Query { get; set; }
 53
 54        /// <summary>
 55        /// Gets or sets the prediction of the requested query.
 56        /// </summary>
 57        [JsonProperty(PropertyName = "prediction")]
 1258        public Prediction Prediction { get; set; }
 59
 60        /// <summary>
 61        /// Validate the object.
 62        /// </summary>
 63        /// <exception cref="ValidationException">
 64        /// Thrown if validation fails
 65        /// </exception>
 66        public virtual void Validate()
 67        {
 068            if (Query == null)
 69            {
 070                throw new ValidationException(ValidationRules.CannotBeNull, "Query");
 71            }
 072            if (Prediction == null)
 73            {
 074                throw new ValidationException(ValidationRules.CannotBeNull, "Prediction");
 75            }
 076            if (Prediction != null)
 77            {
 078                Prediction.Validate();
 79            }
 080        }
 81    }
 82}