< Summary

Class:Azure.ResourceManager.Resources.Models.WhatIfResultFormatExtensions
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfResultFormat.Serialization.cs
Covered lines:5
Uncovered lines:4
Coverable lines:9
Total lines:28
Line coverage:55.5% (5 of 9)
Covered branches:3
Total branches:8
Branch coverage:37.5% (3 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-83.33%75%
ToWhatIfResultFormat(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\WhatIfResultFormat.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.Resources.Models
 11{
 12    internal static class WhatIfResultFormatExtensions
 13    {
 7214        public static string ToSerialString(this WhatIfResultFormat value) => value switch
 7215        {
 12016            WhatIfResultFormat.ResourceIdOnly => "ResourceIdOnly",
 9617            WhatIfResultFormat.FullResourcePayloads => "FullResourcePayloads",
 018            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WhatIfResultFormat value.")
 7219        };
 20
 21        public static WhatIfResultFormat ToWhatIfResultFormat(this string value)
 22        {
 023            if (string.Equals(value, "ResourceIdOnly", StringComparison.InvariantCultureIgnoreCase)) return WhatIfResult
 024            if (string.Equals(value, "FullResourcePayloads", StringComparison.InvariantCultureIgnoreCase)) return WhatIf
 025            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown WhatIfResultFormat value.");
 26        }
 27    }
 28}