< Summary

Class:Microsoft.Azure.OperationalInsights.Models.ErrorResponse
Assembly:Microsoft.Azure.OperationalInsights
File(s):C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Customized\Models\ErrorResponse.cs
C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Generated\Models\ErrorResponse.cs
Covered lines:3
Uncovered lines:13
Coverable lines:16
Total lines:88
Line coverage:18.7% (3 of 16)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\operationalinsights\Microsoft.Azure.OperationalInsights\src\Customized\Models\ErrorResponse.cs

#LineLine coverage
 1using System.Text;
 2
 3namespace Microsoft.Azure.OperationalInsights.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\operationalinsights\Microsoft.Azure.OperationalInsights\src\Generated\Models\ErrorResponse.cs

#LineLine coverage
 1// <auto-generated>
 2// Code generated by Microsoft (R) AutoRest Code Generator.
 3// Changes may cause incorrect behavior and will be lost if the code is
 4// regenerated.
 5// </auto-generated>
 6
 7namespace Microsoft.Azure.OperationalInsights.Models
 8{
 9    using Microsoft.Rest;
 10    using Newtonsoft.Json;
 11    using System.Linq;
 12
 13    /// <summary>
 14    /// Error details.
 15    /// </summary>
 16    /// <remarks>
 17    /// Contains details when the response code indicates an error.
 18    /// </remarks>
 19    public partial class ErrorResponse
 20    {
 21        /// <summary>
 22        /// Initializes a new instance of the ErrorResponse class.
 23        /// </summary>
 224        public ErrorResponse()
 25        {
 26            CustomInit();
 227        }
 28
 29        /// <summary>
 30        /// Initializes a new instance of the ErrorResponse class.
 31        /// </summary>
 32        /// <param name="error">The error details.</param>
 033        public ErrorResponse(ErrorInfo error)
 34        {
 035            Error = error;
 36            CustomInit();
 037        }
 38
 39        /// <summary>
 40        /// An initialization method that performs custom operations like setting defaults
 41        /// </summary>
 42        partial void CustomInit();
 43
 44        /// <summary>
 45        /// Gets or sets the error details.
 46        /// </summary>
 47        [JsonProperty(PropertyName = "error")]
 848        public ErrorInfo Error { get; set; }
 49
 50        /// <summary>
 51        /// Validate the object.
 52        /// </summary>
 53        /// <exception cref="ValidationException">
 54        /// Thrown if validation fails
 55        /// </exception>
 56        public virtual void Validate()
 57        {
 058            if (Error == null)
 59            {
 060                throw new ValidationException(ValidationRules.CannotBeNull, "Error");
 61            }
 062            if (Error != null)
 63            {
 064                Error.Validate();
 65            }
 066        }
 67    }
 68}