< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobErrorCodeExtensions
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErrorCode.Serialization.cs
Covered lines:1
Uncovered lines:22
Coverable lines:23
Total lines:42
Line coverage:4.3% (1 of 23)
Covered branches:1
Total branches:28
Branch coverage:3.5% (1 of 28)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToMediaJobErrorCode(...)-10%5.56%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErrorCode.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 MediaJobErrorCodeExtensions
 13    {
 014        public static string ToSerialString(this MediaJobErrorCode value) => value switch
 015        {
 016            MediaJobErrorCode.ServiceError => "ServiceError",
 017            MediaJobErrorCode.ServiceTransientError => "ServiceTransientError",
 018            MediaJobErrorCode.DownloadNotAccessible => "DownloadNotAccessible",
 019            MediaJobErrorCode.DownloadTransientError => "DownloadTransientError",
 020            MediaJobErrorCode.UploadNotAccessible => "UploadNotAccessible",
 021            MediaJobErrorCode.UploadTransientError => "UploadTransientError",
 022            MediaJobErrorCode.ConfigurationUnsupported => "ConfigurationUnsupported",
 023            MediaJobErrorCode.ContentMalformed => "ContentMalformed",
 024            MediaJobErrorCode.ContentUnsupported => "ContentUnsupported",
 025            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobErrorCode value.")
 026        };
 27
 28        public static MediaJobErrorCode ToMediaJobErrorCode(this string value)
 29        {
 3230            if (string.Equals(value, "ServiceError", StringComparison.InvariantCultureIgnoreCase)) return MediaJobErrorC
 031            if (string.Equals(value, "ServiceTransientError", StringComparison.InvariantCultureIgnoreCase)) return Media
 032            if (string.Equals(value, "DownloadNotAccessible", StringComparison.InvariantCultureIgnoreCase)) return Media
 033            if (string.Equals(value, "DownloadTransientError", StringComparison.InvariantCultureIgnoreCase)) return Medi
 034            if (string.Equals(value, "UploadNotAccessible", StringComparison.InvariantCultureIgnoreCase)) return MediaJo
 035            if (string.Equals(value, "UploadTransientError", StringComparison.InvariantCultureIgnoreCase)) return MediaJ
 036            if (string.Equals(value, "ConfigurationUnsupported", StringComparison.InvariantCultureIgnoreCase)) return Me
 037            if (string.Equals(value, "ContentMalformed", StringComparison.InvariantCultureIgnoreCase)) return MediaJobEr
 038            if (string.Equals(value, "ContentUnsupported", StringComparison.InvariantCultureIgnoreCase)) return MediaJob
 039            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobErrorCode value.");
 40        }
 41    }
 42}