< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.JobActionEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobAction.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:77
Line coverage:0% (0 of 9)
Covered branches:0
Total branches:12
Branch coverage:0% (0 of 12)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobAction.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 JobAction.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum JobAction
 23    {
 24        /// <summary>
 25        /// Take no action.
 26        /// </summary>
 27        [EnumMember(Value = "none")]
 28        None,
 29        /// <summary>
 30        /// Disable the Job. This is equivalent to calling the disable Job API,
 31        /// with a disableTasks value of requeue.
 32        /// </summary>
 33        [EnumMember(Value = "disable")]
 34        Disable,
 35        /// <summary>
 36        /// Terminate the Job. The terminateReason in the Job's executionInfo
 37        /// is set to "TaskFailed".
 38        /// </summary>
 39        [EnumMember(Value = "terminate")]
 40        Terminate
 41    }
 42    internal static class JobActionEnumExtension
 43    {
 44        internal static string ToSerializedValue(this JobAction? value)
 45        {
 046            return value == null ? null : ((JobAction)value).ToSerializedValue();
 47        }
 48
 49        internal static string ToSerializedValue(this JobAction value)
 50        {
 51            switch( value )
 52            {
 53                case JobAction.None:
 054                    return "none";
 55                case JobAction.Disable:
 056                    return "disable";
 57                case JobAction.Terminate:
 058                    return "terminate";
 59            }
 060            return null;
 61        }
 62
 63        internal static JobAction? ParseJobAction(this string value)
 64        {
 65            switch( value )
 66            {
 67                case "none":
 068                    return JobAction.None;
 69                case "disable":
 070                    return JobAction.Disable;
 71                case "terminate":
 072                    return JobAction.Terminate;
 73            }
 074            return null;
 75        }
 76    }
 77}