< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobStateExtensions
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobState.Serialization.cs
Covered lines:7
Uncovered lines:12
Coverable lines:19
Total lines:38
Line coverage:36.8% (7 of 19)
Covered branches:13
Total branches:22
Branch coverage:59% (13 of 22)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
ToSerialString(...)-0%0%
ToMediaJobState(...)-87.5%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobState.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 MediaJobStateExtensions
 13    {
 014        public static string ToSerialString(this MediaJobState value) => value switch
 015        {
 016            MediaJobState.Canceled => "Canceled",
 017            MediaJobState.Canceling => "Canceling",
 018            MediaJobState.Error => "Error",
 019            MediaJobState.Finished => "Finished",
 020            MediaJobState.Processing => "Processing",
 021            MediaJobState.Queued => "Queued",
 022            MediaJobState.Scheduled => "Scheduled",
 023            _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobState value.")
 024        };
 25
 26        public static MediaJobState ToMediaJobState(this string value)
 27        {
 6828            if (string.Equals(value, "Canceled", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Canc
 6429            if (string.Equals(value, "Canceling", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Can
 5430            if (string.Equals(value, "Error", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Error;
 4831            if (string.Equals(value, "Finished", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Fini
 5632            if (string.Equals(value, "Processing", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Pr
 2033            if (string.Equals(value, "Queued", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Queued
 2434            if (string.Equals(value, "Scheduled", StringComparison.InvariantCultureIgnoreCase)) return MediaJobState.Sch
 035            throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MediaJobState value.");
 36        }
 37    }
 38}