< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\SubtaskState.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 SubtaskState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum SubtaskState
 23    {
 24        /// <summary>
 25        /// The Task has been assigned to a Compute Node, but is waiting for a
 26        /// required Job Preparation Task to complete on the Compute Node. If
 27        /// the Job Preparation Task succeeds, the Task will move to running.
 28        /// If the Job Preparation Task fails, the Task will return to active
 29        /// and will be eligible to be assigned to a different Compute Node.
 30        /// </summary>
 31        [EnumMember(Value = "preparing")]
 32        Preparing,
 33        /// <summary>
 34        /// The Task is running on a Compute Node. This includes task-level
 35        /// preparation such as downloading resource files or deploying
 36        /// Packages specified on the Task - it does not necessarily mean that
 37        /// the Task command line has started executing.
 38        /// </summary>
 39        [EnumMember(Value = "running")]
 40        Running,
 41        /// <summary>
 42        /// The Task is no longer eligible to run, usually because the Task has
 43        /// finished successfully, or the Task has finished unsuccessfully and
 44        /// has exhausted its retry limit. A Task is also marked as completed
 45        /// if an error occurred launching the Task, or when the Task has been
 46        /// terminated.
 47        /// </summary>
 48        [EnumMember(Value = "completed")]
 49        Completed
 50    }
 51    internal static class SubtaskStateEnumExtension
 52    {
 53        internal static string ToSerializedValue(this SubtaskState? value)
 54        {
 055            return value == null ? null : ((SubtaskState)value).ToSerializedValue();
 56        }
 57
 58        internal static string ToSerializedValue(this SubtaskState value)
 59        {
 60            switch( value )
 61            {
 62                case SubtaskState.Preparing:
 063                    return "preparing";
 64                case SubtaskState.Running:
 065                    return "running";
 66                case SubtaskState.Completed:
 067                    return "completed";
 68            }
 069            return null;
 70        }
 71
 72        internal static SubtaskState? ParseSubtaskState(this string value)
 73        {
 74            switch( value )
 75            {
 76                case "preparing":
 077                    return SubtaskState.Preparing;
 78                case "running":
 079                    return SubtaskState.Running;
 80                case "completed":
 081                    return SubtaskState.Completed;
 82            }
 083            return null;
 84        }
 85    }
 86}