< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.DisableJobOptionEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\DisableJobOption.cs
Covered lines:0
Uncovered lines:9
Coverable lines:9
Total lines:78
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%
ParseDisableJobOption(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\DisableJobOption.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 DisableJobOption.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum DisableJobOption
 23    {
 24        /// <summary>
 25        /// Terminate running Tasks and requeue them. The Tasks will run again
 26        /// when the Job is enabled.
 27        /// </summary>
 28        [EnumMember(Value = "requeue")]
 29        Requeue,
 30        /// <summary>
 31        /// Terminate running Tasks. The Tasks will be completed with
 32        /// failureInfo indicating that they were terminated, and will not run
 33        /// again.
 34        /// </summary>
 35        [EnumMember(Value = "terminate")]
 36        Terminate,
 37        /// <summary>
 38        /// Allow currently running Tasks to complete.
 39        /// </summary>
 40        [EnumMember(Value = "wait")]
 41        Wait
 42    }
 43    internal static class DisableJobOptionEnumExtension
 44    {
 45        internal static string ToSerializedValue(this DisableJobOption? value)
 46        {
 047            return value == null ? null : ((DisableJobOption)value).ToSerializedValue();
 48        }
 49
 50        internal static string ToSerializedValue(this DisableJobOption value)
 51        {
 52            switch( value )
 53            {
 54                case DisableJobOption.Requeue:
 055                    return "requeue";
 56                case DisableJobOption.Terminate:
 057                    return "terminate";
 58                case DisableJobOption.Wait:
 059                    return "wait";
 60            }
 061            return null;
 62        }
 63
 64        internal static DisableJobOption? ParseDisableJobOption(this string value)
 65        {
 66            switch( value )
 67            {
 68                case "requeue":
 069                    return DisableJobOption.Requeue;
 70                case "terminate":
 071                    return DisableJobOption.Terminate;
 72                case "wait":
 073                    return DisableJobOption.Wait;
 74            }
 075            return null;
 76        }
 77    }
 78}