< Summary

Class:Microsoft.Azure.ApplicationInsights.Query.Models.ErrorResponse
Assembly:Microsoft.Azure.ApplicationInsights.Query
File(s):C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\Models\ErrorResponse.cs
C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\Models\ErrorResponse.cs
Covered lines:0
Uncovered lines:16
Coverable lines:16
Total lines:92
Line coverage:0% (0 of 16)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToString()-0%0%
.ctor()-0%100%
.ctor(...)-0%100%
get_Error()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Customized\Models\ErrorResponse.cs

#LineLine coverage
 1using System.Text;
 2
 3namespace Microsoft.Azure.ApplicationInsights.Query.Models
 4{
 5    public partial class ErrorResponse
 6    {
 7        public override string ToString()
 8        {
 09            var sb = new StringBuilder();
 010            sb.AppendLine(base.ToString());
 11
 012            if (Error != null)
 13            {
 014                Error.PrettyPrint(sb);
 15            }
 16
 017            return sb.ToString();
 18        }
 19    }
 20}

C:\Git\azure-sdk-for-net\sdk\applicationinsights\Microsoft.Azure.ApplicationInsights.Query\src\Generated\Models\ErrorResponse.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.ApplicationInsights.Query.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// Error details.
 19    /// </summary>
 20    /// <remarks>
 21    /// Contains details when the response code indicates an error.
 22    /// </remarks>
 23    public partial class ErrorResponse
 24    {
 25        /// <summary>
 26        /// Initializes a new instance of the ErrorResponse class.
 27        /// </summary>
 028        public ErrorResponse()
 29        {
 30            CustomInit();
 031        }
 32
 33        /// <summary>
 34        /// Initializes a new instance of the ErrorResponse class.
 35        /// </summary>
 36        /// <param name="error">The error details.</param>
 037        public ErrorResponse(ErrorInfo error)
 38        {
 039            Error = error;
 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 error details.
 50        /// </summary>
 51        [JsonProperty(PropertyName = "error")]
 052        public ErrorInfo Error { get; set; }
 53
 54        /// <summary>
 55        /// Validate the object.
 56        /// </summary>
 57        /// <exception cref="ValidationException">
 58        /// Thrown if validation fails
 59        /// </exception>
 60        public virtual void Validate()
 61        {
 062            if (Error == null)
 63            {
 064                throw new ValidationException(ValidationRules.CannotBeNull, "Error");
 65            }
 066            if (Error != null)
 67            {
 068                Error.Validate();
 69            }
 070        }
 71    }
 72}