< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\CachingType.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 CachingType.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum CachingType
 23    {
 24        /// <summary>
 25        /// The caching mode for the disk is not enabled.
 26        /// </summary>
 27        [EnumMember(Value = "none")]
 28        None,
 29        /// <summary>
 30        /// The caching mode for the disk is read only.
 31        /// </summary>
 32        [EnumMember(Value = "readonly")]
 33        ReadOnly,
 34        /// <summary>
 35        /// The caching mode for the disk is read and write.
 36        /// </summary>
 37        [EnumMember(Value = "readwrite")]
 38        ReadWrite
 39    }
 40    internal static class CachingTypeEnumExtension
 41    {
 42        internal static string ToSerializedValue(this CachingType? value)
 43        {
 044            return value == null ? null : ((CachingType)value).ToSerializedValue();
 45        }
 46
 47        internal static string ToSerializedValue(this CachingType value)
 48        {
 49            switch( value )
 50            {
 51                case CachingType.None:
 052                    return "none";
 53                case CachingType.ReadOnly:
 054                    return "readonly";
 55                case CachingType.ReadWrite:
 056                    return "readwrite";
 57            }
 058            return null;
 59        }
 60
 61        internal static CachingType? ParseCachingType(this string value)
 62        {
 63            switch( value )
 64            {
 65                case "none":
 066                    return CachingType.None;
 67                case "readonly":
 068                    return CachingType.ReadOnly;
 69                case "readwrite":
 070                    return CachingType.ReadWrite;
 71            }
 072            return null;
 73        }
 74    }
 75}