< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.JobReleaseTaskStateEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobReleaseTaskState.cs
Covered lines:0
Uncovered lines:7
Coverable lines:7
Total lines:69
Line coverage:0% (0 of 7)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\JobReleaseTaskState.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 JobReleaseTaskState.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum JobReleaseTaskState
 23    {
 24        /// <summary>
 25        /// The Task is currently running (including retrying).
 26        /// </summary>
 27        [EnumMember(Value = "running")]
 28        Running,
 29        /// <summary>
 30        /// The Task has exited with exit code 0, or the Task has exhausted its
 31        /// retry limit, or the Batch service was unable to start the Task due
 32        /// to Task preparation errors (such as resource file download
 33        /// failures).
 34        /// </summary>
 35        [EnumMember(Value = "completed")]
 36        Completed
 37    }
 38    internal static class JobReleaseTaskStateEnumExtension
 39    {
 40        internal static string ToSerializedValue(this JobReleaseTaskState? value)
 41        {
 042            return value == null ? null : ((JobReleaseTaskState)value).ToSerializedValue();
 43        }
 44
 45        internal static string ToSerializedValue(this JobReleaseTaskState value)
 46        {
 47            switch( value )
 48            {
 49                case JobReleaseTaskState.Running:
 050                    return "running";
 51                case JobReleaseTaskState.Completed:
 052                    return "completed";
 53            }
 054            return null;
 55        }
 56
 57        internal static JobReleaseTaskState? ParseJobReleaseTaskState(this string value)
 58        {
 59            switch( value )
 60            {
 61                case "running":
 062                    return JobReleaseTaskState.Running;
 63                case "completed":
 064                    return JobReleaseTaskState.Completed;
 65            }
 066            return null;
 67        }
 68    }
 69}