< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCategoryExtensions
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErrorCategory.Serialization.cs
Covered lines:1
Uncovered lines:14
Coverable lines:15
Total lines:34
Line coverage:6.6% (1 of 15)
Covered branches:1
Total branches:16
Branch coverage:6.2% (1 of 16)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToMediaJobErrorCategory(...)-16.67%10%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErrorCategory.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.Messaging.EventGrid.SystemEvents
 11{
 12    internal static class MediaJobErrorCategoryExtensions
 13    {
 014        public static string ToSerialString(this MediaJobErrorCategory value) => value switch
 015        {
 016            MediaJobErrorCategory.Service => "Service",
 017            MediaJobErrorCategory.Download => "Download",
 018            MediaJobErrorCategory.Upload => "Upload",
 019            MediaJobErrorCategory.Configuration => "Configuration",
 020            MediaJobErrorCategory.Content => "Content",
 021            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobErrorCategory value.")
 022        };
 23
 24        public static MediaJobErrorCategory ToMediaJobErrorCategory(this string value)
 25        {
 3226            if (string.Equals(value, "Service", StringComparison.InvariantCultureIgnoreCase)) return MediaJobErrorCatego
 027            if (string.Equals(value, "Download", StringComparison.InvariantCultureIgnoreCase)) return MediaJobErrorCateg
 028            if (string.Equals(value, "Upload", StringComparison.InvariantCultureIgnoreCase)) return MediaJobErrorCategor
 029            if (string.Equals(value, "Configuration", StringComparison.InvariantCultureIgnoreCase)) return MediaJobError
 030            if (string.Equals(value, "Content", StringComparison.InvariantCultureIgnoreCase)) return MediaJobErrorCatego
 031            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobErrorCategory value.");
 32        }
 33    }
 34}