< Summary

Class:Microsoft.Azure.HDInsight.Job.Models.ApplicationStateEnumExtension
Assembly:Microsoft.Azure.HDInsight.Job
File(s):C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Generated\Models\ApplicationState.cs
Covered lines:0
Uncovered lines:21
Coverable lines:21
Total lines:102
Line coverage:0% (0 of 21)
Covered branches:0
Total branches:54
Branch coverage:0% (0 of 54)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\hdinsight\Microsoft.Azure.HDInsight.Job\src\Generated\Models\ApplicationState.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.HDInsight.Job.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 ApplicationState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum ApplicationState
 23    {
 24        [EnumMember(Value = "NEW")]
 25        NEW,
 26        [EnumMember(Value = "NEW_SAVING")]
 27        NEWSAVING,
 28        [EnumMember(Value = "SUBMITTED")]
 29        SUBMITTED,
 30        [EnumMember(Value = "ACCEPTED")]
 31        ACCEPTED,
 32        [EnumMember(Value = "RUNNING")]
 33        RUNNING,
 34        [EnumMember(Value = "FINISHED")]
 35        FINISHED,
 36        [EnumMember(Value = "FINISHING")]
 37        FINISHING,
 38        [EnumMember(Value = "FAILED")]
 39        FAILED,
 40        [EnumMember(Value = "KILLED")]
 41        KILLED
 42    }
 43    internal static class ApplicationStateEnumExtension
 44    {
 45        internal static string ToSerializedValue(this ApplicationState? value)
 46        {
 047            return value == null ? null : ((ApplicationState)value).ToSerializedValue();
 48        }
 49
 50        internal static string ToSerializedValue(this ApplicationState value)
 51        {
 52            switch( value )
 53            {
 54                case ApplicationState.NEW:
 055                    return "NEW";
 56                case ApplicationState.NEWSAVING:
 057                    return "NEW_SAVING";
 58                case ApplicationState.SUBMITTED:
 059                    return "SUBMITTED";
 60                case ApplicationState.ACCEPTED:
 061                    return "ACCEPTED";
 62                case ApplicationState.RUNNING:
 063                    return "RUNNING";
 64                case ApplicationState.FINISHED:
 065                    return "FINISHED";
 66                case ApplicationState.FINISHING:
 067                    return "FINISHING";
 68                case ApplicationState.FAILED:
 069                    return "FAILED";
 70                case ApplicationState.KILLED:
 071                    return "KILLED";
 72            }
 073            return null;
 74        }
 75
 76        internal static ApplicationState? ParseApplicationState(this string value)
 77        {
 78            switch( value )
 79            {
 80                case "NEW":
 081                    return ApplicationState.NEW;
 82                case "NEW_SAVING":
 083                    return ApplicationState.NEWSAVING;
 84                case "SUBMITTED":
 085                    return ApplicationState.SUBMITTED;
 86                case "ACCEPTED":
 087                    return ApplicationState.ACCEPTED;
 88                case "RUNNING":
 089                    return ApplicationState.RUNNING;
 90                case "FINISHED":
 091                    return ApplicationState.FINISHED;
 92                case "FINISHING":
 093                    return ApplicationState.FINISHING;
 94                case "FAILED":
 095                    return ApplicationState.FAILED;
 96                case "KILLED":
 097                    return ApplicationState.KILLED;
 98            }
 099            return null;
 100        }
 101    }
 102}