< Summary

Class:Azure.ResourceManager.Compute.Models.HostCachingExtensions
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\HostCaching.Serialization.cs
Covered lines:1
Uncovered lines:10
Coverable lines:11
Total lines:30
Line coverage:9% (1 of 11)
Covered branches:1
Total branches:10
Branch coverage:10% (1 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToHostCaching(...)-25%16.67%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\HostCaching.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 HostCachingExtensions
 13    {
 014        public static string ToSerialString(this HostCaching value) => value switch
 015        {
 016            HostCaching.None => "None",
 017            HostCaching.ReadOnly => "ReadOnly",
 018            HostCaching.ReadWrite => "ReadWrite",
 019            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostCaching value.")
 020        };
 21
 22        public static HostCaching ToHostCaching(this string value)
 23        {
 4824            if (string.Equals(value, "None", StringComparison.InvariantCultureIgnoreCase)) return HostCaching.None;
 025            if (string.Equals(value, "ReadOnly", StringComparison.InvariantCultureIgnoreCase)) return HostCaching.ReadOn
 026            if (string.Equals(value, "ReadWrite", StringComparison.InvariantCultureIgnoreCase)) return HostCaching.ReadW
 027            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown HostCaching value.");
 28        }
 29    }
 30}