< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\PoolLifetimeOption.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 PoolLifetimeOption.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum PoolLifetimeOption
 23    {
 24        /// <summary>
 25        /// The Pool exists for the lifetime of the Job Schedule. The Batch
 26        /// Service creates the Pool when it creates the first Job on the
 27        /// schedule. You may apply this option only to Job Schedules, not to
 28        /// Jobs.
 29        /// </summary>
 30        [EnumMember(Value = "jobschedule")]
 31        JobSchedule,
 32        /// <summary>
 33        /// The Pool exists for the lifetime of the Job to which it is
 34        /// dedicated. The Batch service creates the Pool when it creates the
 35        /// Job. If the 'job' option is applied to a Job Schedule, the Batch
 36        /// service creates a new auto Pool for every Job created on the
 37        /// schedule.
 38        /// </summary>
 39        [EnumMember(Value = "job")]
 40        Job
 41    }
 42    internal static class PoolLifetimeOptionEnumExtension
 43    {
 44        internal static string ToSerializedValue(this PoolLifetimeOption? value)
 45        {
 046            return value == null ? null : ((PoolLifetimeOption)value).ToSerializedValue();
 47        }
 48
 49        internal static string ToSerializedValue(this PoolLifetimeOption value)
 50        {
 51            switch( value )
 52            {
 53                case PoolLifetimeOption.JobSchedule:
 054                    return "jobschedule";
 55                case PoolLifetimeOption.Job:
 056                    return "job";
 57            }
 058            return null;
 59        }
 60
 61        internal static PoolLifetimeOption? ParsePoolLifetimeOption(this string value)
 62        {
 63            switch( value )
 64            {
 65                case "jobschedule":
 066                    return PoolLifetimeOption.JobSchedule;
 67                case "job":
 068                    return PoolLifetimeOption.Job;
 69            }
 070            return null;
 71        }
 72    }
 73}