< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.ErrorCategoryEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\ErrorCategory.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:66
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerializedValue(...)-0%0%
ToSerializedValue(...)-0%0%
ParseErrorCategory(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\ErrorCategory.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.Batch.Protocol.Models
 12{
 13    using Newtonsoft.Json;
 14    using Newtonsoft.Json.Converters;
 15    using System.Runtime;
 16    using System.Runtime.Serialization;
 17
 18    /// <summary>
 19    /// Defines values for ErrorCategory.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum ErrorCategory
 23    {
 24        /// <summary>
 25        /// The error is due to a user issue, such as misconfiguration.
 26        /// </summary>
 27        [EnumMember(Value = "usererror")]
 28        UserError,
 29        /// <summary>
 30        /// The error is due to an internal server issue.
 31        /// </summary>
 32        [EnumMember(Value = "servererror")]
 33        ServerError
 34    }
 35    internal static class ErrorCategoryEnumExtension
 36    {
 37        internal static string ToSerializedValue(this ErrorCategory? value)
 38        {
 039            return value == null ? null : ((ErrorCategory)value).ToSerializedValue();
 40        }
 41
 42        internal static string ToSerializedValue(this ErrorCategory value)
 43        {
 44            switch( value )
 45            {
 46                case ErrorCategory.UserError:
 047                    return "usererror";
 48                case ErrorCategory.ServerError:
 049                    return "servererror";
 50            }
 051            return null;
 52        }
 53
 54        internal static ErrorCategory? ParseErrorCategory(this string value)
 55        {
 56            switch( value )
 57            {
 58                case "usererror":
 059                    return ErrorCategory.UserError;
 60                case "servererror":
 061                    return ErrorCategory.ServerError;
 62            }
 063            return null;
 64        }
 65    }
 66}