< Summary

Class:Azure.ResourceManager.Network.Models.VirtualNetworkConnectionGatewayReference
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkConnectionGatewayReference.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkConnectionGatewayReference.Serialization.cs
Covered lines:9
Uncovered lines:7
Coverable lines:16
Total lines:67
Line coverage:56.2% (9 of 16)
Covered branches:5
Total branches:6
Branch coverage:83.3% (5 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-80%50%
get_Id()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%100%
DeserializeVirtualNetworkConnectionGatewayReference(...)-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkConnectionGatewayReference.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.ResourceManager.Network.Models
 11{
 12    /// <summary> A reference to VirtualNetworkGateway or LocalNetworkGateway resource. </summary>
 13    public partial class VirtualNetworkConnectionGatewayReference
 14    {
 15        /// <summary> Initializes a new instance of VirtualNetworkConnectionGatewayReference. </summary>
 16        /// <param name="id"> The ID of VirtualNetworkGateway or LocalNetworkGateway resource. </param>
 817        public VirtualNetworkConnectionGatewayReference(string id)
 18        {
 819            if (id == null)
 20            {
 021                throw new ArgumentNullException(nameof(id));
 22            }
 23
 824            Id = id;
 825        }
 26
 27        /// <summary> The ID of VirtualNetworkGateway or LocalNetworkGateway resource. </summary>
 028        public string Id { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\VirtualNetworkConnectionGatewayReference.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.ResourceManager.Network.Models
 12{
 13    public partial class VirtualNetworkConnectionGatewayReference : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("id");
 019            writer.WriteStringValue(Id);
 020            writer.WriteEndObject();
 021        }
 22
 23        internal static VirtualNetworkConnectionGatewayReference DeserializeVirtualNetworkConnectionGatewayReference(Jso
 24        {
 825            string id = default;
 3226            foreach (var property in element.EnumerateObject())
 27            {
 828                if (property.NameEquals("id"))
 29                {
 830                    id = property.Value.GetString();
 31                    continue;
 32                }
 33            }
 834            return new VirtualNetworkConnectionGatewayReference(id);
 35        }
 36    }
 37}