< Summary

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

File(s)

C:\Git\azure-sdk-for-net\sdk\batch\Microsoft.Azure.Batch\src\GeneratedProtocol\Models\ElevationLevel.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 ElevationLevel.
 20    /// </summary>
 21    [JsonConverter(typeof(StringEnumConverter))]
 22    public enum ElevationLevel
 23    {
 24        /// <summary>
 25        /// The user is a standard user without elevated access.
 26        /// </summary>
 27        [EnumMember(Value = "nonadmin")]
 28        NonAdmin,
 29        /// <summary>
 30        /// The user is a user with elevated access and operates with full
 31        /// Administrator permissions.
 32        /// </summary>
 33        [EnumMember(Value = "admin")]
 34        Admin
 35    }
 36    internal static class ElevationLevelEnumExtension
 37    {
 38        internal static string ToSerializedValue(this ElevationLevel? value)
 39        {
 040            return value == null ? null : ((ElevationLevel)value).ToSerializedValue();
 41        }
 42
 43        internal static string ToSerializedValue(this ElevationLevel value)
 44        {
 45            switch( value )
 46            {
 47                case ElevationLevel.NonAdmin:
 048                    return "nonadmin";
 49                case ElevationLevel.Admin:
 050                    return "admin";
 51            }
 052            return null;
 53        }
 54
 55        internal static ElevationLevel? ParseElevationLevel(this string value)
 56        {
 57            switch( value )
 58            {
 59                case "nonadmin":
 060                    return ElevationLevel.NonAdmin;
 61                case "admin":
 062                    return ElevationLevel.Admin;
 63            }
 064            return null;
 65        }
 66    }
 67}