< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.MediaJobErroredEventData
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErroredEventData.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErroredEventData.Serialization.cs
Covered lines:25
Uncovered lines:5
Coverable lines:30
Total lines:93
Line coverage:83.3% (25 of 30)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Outputs()-100%100%
DeserializeMediaJobErroredEventData(...)-91.3%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErroredEventData.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.Collections.Generic;
 9using Azure.Core;
 10
 11namespace Azure.Messaging.EventGrid.SystemEvents
 12{
 13    /// <summary> Job error state event data. </summary>
 14    public partial class MediaJobErroredEventData : MediaJobStateChangeEventData
 15    {
 16        /// <summary> Initializes a new instance of MediaJobErroredEventData. </summary>
 017        internal MediaJobErroredEventData()
 18        {
 019            Outputs = new ChangeTrackingList<MediaJobOutput>();
 020        }
 21
 22        /// <summary> Initializes a new instance of MediaJobErroredEventData. </summary>
 23        /// <param name="previousState"> The previous state of the Job. </param>
 24        /// <param name="state"> The new state of the Job. </param>
 25        /// <param name="correlationData"> Gets the Job correlation data. </param>
 26        /// <param name="outputs"> Gets the Job outputs. </param>
 227        internal MediaJobErroredEventData(MediaJobState? previousState, MediaJobState? state, IReadOnlyDictionary<string
 28        {
 229            Outputs = outputs;
 230        }
 31
 32        /// <summary> Gets the Job outputs. </summary>
 1233        public IReadOnlyList<MediaJobOutput> Outputs { get; }
 34    }
 35}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\MediaJobErroredEventData.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.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Messaging.EventGrid.SystemEvents
 13{
 14    public partial class MediaJobErroredEventData
 15    {
 16        internal static MediaJobErroredEventData DeserializeMediaJobErroredEventData(JsonElement element)
 17        {
 218            Optional<IReadOnlyList<MediaJobOutput>> outputs = default;
 219            Optional<MediaJobState> previousState = default;
 220            Optional<MediaJobState> state = default;
 221            Optional<IReadOnlyDictionary<string, string>> correlationData = default;
 2022            foreach (var property in element.EnumerateObject())
 23            {
 824                if (property.NameEquals("outputs"))
 25                {
 226                    List<MediaJobOutput> array = new List<MediaJobOutput>();
 827                    foreach (var item in property.Value.EnumerateArray())
 28                    {
 229                        array.Add(MediaJobOutput.DeserializeMediaJobOutput(item));
 30                    }
 231                    outputs = array;
 232                    continue;
 33                }
 634                if (property.NameEquals("previousState"))
 35                {
 236                    previousState = property.Value.GetString().ToMediaJobState();
 237                    continue;
 38                }
 439                if (property.NameEquals("state"))
 40                {
 241                    state = property.Value.GetString().ToMediaJobState();
 242                    continue;
 43                }
 244                if (property.NameEquals("correlationData"))
 45                {
 246                    Dictionary<string, string> dictionary = new Dictionary<string, string>();
 047                    foreach (var property0 in property.Value.EnumerateObject())
 48                    {
 049                        dictionary.Add(property0.Name, property0.Value.GetString());
 50                    }
 251                    correlationData = dictionary;
 52                    continue;
 53                }
 54            }
 255            return new MediaJobErroredEventData(Optional.ToNullable(previousState), Optional.ToNullable(state), Optional
 56        }
 57    }
 58}