< Summary

Class:Microsoft.Azure.Batch.Protocol.Models.OutputFileUploadConditionEnumExtension
Assembly:Microsoft.Azure.Batch
File(s):C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\OutputFileUploadCondition.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%
ParseOutputFileUploadCondition(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\OutputFileUploadCondition.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 OutputFileUploadCondition.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum OutputFileUploadCondition
 23    {
 24        /// <summary>
 25        /// Upload the file(s) only after the Task process exits with an exit
 26        /// code of 0.
 27        /// </summary>
 28        [EnumMember(Value = "tasksuccess")]
 29        TaskSuccess,
 30        /// <summary>
 31        /// Upload the file(s) only after the Task process exits with a nonzero
 32        /// exit code.
 33        /// </summary>
 34        [EnumMember(Value = "taskfailure")]
 35        TaskFailure,
 36        /// <summary>
 37        /// Upload the file(s) after the Task process exits, no matter what the
 38        /// exit code was.
 39        /// </summary>
 40        [EnumMember(Value = "taskcompletion")]
 41        TaskCompletion
 42    }
 43    internal static class OutputFileUploadConditionEnumExtension
 44    {
 45        internal static string ToSerializedValue(this OutputFileUploadCondition? value)
 46        {
 047            return value == null ? null : ((OutputFileUploadCondition)value).ToSerializedValue();
 48        }
 49
 50        internal static string ToSerializedValue(this OutputFileUploadCondition value)
 51        {
 52            switch( value )
 53            {
 54                case OutputFileUploadCondition.TaskSuccess:
 055                    return "tasksuccess";
 56                case OutputFileUploadCondition.TaskFailure:
 057                    return "taskfailure";
 58                case OutputFileUploadCondition.TaskCompletion:
 059                    return "taskcompletion";
 60            }
 061            return null;
 62        }
 63
 64        internal static OutputFileUploadCondition? ParseOutputFileUploadCondition(this string value)
 65        {
 66            switch( value )
 67            {
 68                case "tasksuccess":
 069                    return OutputFileUploadCondition.TaskSuccess;
 70                case "taskfailure":
 071                    return OutputFileUploadCondition.TaskFailure;
 72                case "taskcompletion":
 073                    return OutputFileUploadCondition.TaskCompletion;
 74            }
 075            return null;
 76        }
 77    }
 78}