< Summary

Class:Azure.ResourceManager.Compute.Models.CachingTypesExtensions
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\CachingTypes.Serialization.cs
Covered lines:7
Uncovered lines:4
Coverable lines:11
Total lines:30
Line coverage:63.6% (7 of 11)
Covered branches:5
Total branches:10
Branch coverage:50% (5 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-71.43%50%
ToCachingTypes(...)-50%50%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\CachingTypes.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    internal static class CachingTypesExtensions
 13    {
 45614        public static string ToSerialString(this CachingTypes value) => value switch
 45615        {
 90416            CachingTypes.None => "None",
 46417            CachingTypes.ReadOnly => "ReadOnly",
 018            CachingTypes.ReadWrite => "ReadWrite",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CachingTypes value.")
 45620        };
 21
 22        public static CachingTypes ToCachingTypes(this string value)
 23        {
 278424            if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return CachingTypes.None;
 3225            if (string.Equals(value, "ReadOnly", StringComparison.InvariantCultureIgnoreCase)) return CachingTypes.ReadO
 026            if (string.Equals(value, "ReadWrite", StringComparison.InvariantCultureIgnoreCase)) return CachingTypes.Read
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown CachingTypes value.");
 28        }
 29    }
 30}