< Summary

Class:Azure.Messaging.EventGrid.SystemEvents.ContainerRegistryEventSource
Assembly:Azure.Messaging.EventGrid
File(s):C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventSource.cs
C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventSource.Serialization.cs
Covered lines:13
Uncovered lines:4
Coverable lines:17
Total lines:67
Line coverage:76.4% (13 of 17)
Covered branches:6
Total branches:6
Branch coverage:100% (6 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Addr()-0%100%
get_InstanceID()-0%100%
DeserializeContainerRegistryEventSource(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventSource.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
 8namespace Azure.Messaging.EventGrid.SystemEvents
 9{
 10    /// <summary> The registry node that generated the event. Put differently, while the actor initiates the event, the 
 11    public partial class ContainerRegistryEventSource
 12    {
 13        /// <summary> Initializes a new instance of ContainerRegistryEventSource. </summary>
 014        internal ContainerRegistryEventSource()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of ContainerRegistryEventSource. </summary>
 19        /// <param name="addr"> The IP or hostname and the port of the registry node that generated the event. Generally
 20        /// <param name="instanceID"> The running instance of an application. Changes after each restart. </param>
 421        internal ContainerRegistryEventSource(string addr, string instanceID)
 22        {
 423            Addr = addr;
 424            InstanceID = instanceID;
 425        }
 26
 27        /// <summary> The IP or hostname and the port of the registry node that generated the event. Generally, this wil
 028        public string Addr { get; }
 29        /// <summary> The running instance of an application. Changes after each restart. </summary>
 030        public string InstanceID { get; }
 31    }
 32}

C:\Git\azure-sdk-for-net\sdk\eventgrid\Azure.Messaging.EventGrid\src\Generated\Models\ContainerRegistryEventSource.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Messaging.EventGrid.SystemEvents
 12{
 13    public partial class ContainerRegistryEventSource
 14    {
 15        internal static ContainerRegistryEventSource DeserializeContainerRegistryEventSource(JsonElement element)
 16        {
 417            Optional<string> addr = default;
 418            Optional<string> instanceID = default;
 2419            foreach (var property in element.EnumerateObject())
 20            {
 821                if (property.NameEquals("addr"))
 22                {
 423                    addr = property.Value.GetString();
 424                    continue;
 25                }
 426                if (property.NameEquals("instanceID"))
 27                {
 428                    instanceID = property.Value.GetString();
 29                    continue;
 30                }
 31            }
 432            return new ContainerRegistryEventSource(addr.Value, instanceID.Value);
 33        }
 34    }
 35}