< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\DisableComputeNodeSchedulingOption.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 DisableComputeNodeSchedulingOption.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum DisableComputeNodeSchedulingOption
 23    {
 24        /// <summary>
 25        /// Terminate running Task processes and requeue the Tasks. The Tasks
 26        /// may run again on other Compute Nodes, or when Task scheduling is
 27        /// re-enabled on this Compute Node. Enter offline state as soon as
 28        /// Tasks have been terminated.
 29        /// </summary>
 30        [EnumMember(Value = "requeue")]
 31        Requeue,
 32        /// <summary>
 33        /// Terminate running Tasks. The Tasks will be completed with
 34        /// failureInfo indicating that they were terminated, and will not run
 35        /// again. Enter offline state as soon as Tasks have been terminated.
 36        /// </summary>
 37        [EnumMember(Value = "terminate")]
 38        Terminate,
 39        /// <summary>
 40        /// Allow currently running Tasks to complete. Schedule no new Tasks
 41        /// while waiting. Enter offline state when all Tasks have completed.
 42        /// </summary>
 43        [EnumMember(Value = "taskcompletion")]
 44        TaskCompletion
 45    }
 46    internal static class DisableComputeNodeSchedulingOptionEnumExtension
 47    {
 48        internal static string ToSerializedValue(this DisableComputeNodeSchedulingOption? value)
 49        {
 050            return value == null ? null : ((DisableComputeNodeSchedulingOption)value).ToSerializedValue();
 51        }
 52
 53        internal static string ToSerializedValue(this DisableComputeNodeSchedulingOption value)
 54        {
 55            switch( value )
 56            {
 57                case DisableComputeNodeSchedulingOption.Requeue:
 058                    return "requeue";
 59                case DisableComputeNodeSchedulingOption.Terminate:
 060                    return "terminate";
 61                case DisableComputeNodeSchedulingOption.TaskCompletion:
 062                    return "taskcompletion";
 63            }
 064            return null;
 65        }
 66
 67        internal static DisableComputeNodeSchedulingOption? ParseDisableComputeNodeSchedulingOption(this string value)
 68        {
 69            switch( value )
 70            {
 71                case "requeue":
 072                    return DisableComputeNodeSchedulingOption.Requeue;
 73                case "terminate":
 074                    return DisableComputeNodeSchedulingOption.Terminate;
 75                case "taskcompletion":
 076                    return DisableComputeNodeSchedulingOption.TaskCompletion;
 77            }
 078            return null;
 79        }
 80    }
 81}