< Summary

Class:Azure.ResourceManager.Compute.Models.NetworkProfile
Assembly:Azure.ResourceManager.Compute
File(s):C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\NetworkProfile.cs
C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\NetworkProfile.Serialization.cs
Covered lines:25
Uncovered lines:1
Coverable lines:26
Total lines:92
Line coverage:96.1% (25 of 26)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-100%100%
get_NetworkInterfaces()-100%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-100%100%
DeserializeNetworkProfile(...)-90.91%90%

File(s)

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\NetworkProfile.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;
 9
 10namespace Azure.ResourceManager.Compute.Models
 11{
 12    /// <summary> Specifies the network interfaces of the virtual machine. </summary>
 13    public partial class NetworkProfile
 14    {
 15        /// <summary> Initializes a new instance of NetworkProfile. </summary>
 11616        public NetworkProfile()
 17        {
 11618        }
 19
 20        /// <summary> Initializes a new instance of NetworkProfile. </summary>
 21        /// <param name="networkInterfaces"> Specifies the list of resource Ids for the network interfaces associated wi
 43222        internal NetworkProfile(IList<NetworkInterfaceReference> networkInterfaces)
 23        {
 43224            NetworkInterfaces = networkInterfaces;
 43225        }
 26
 27        /// <summary> Specifies the list of resource Ids for the network interfaces associated with the virtual machine.
 105228        public IList<NetworkInterfaceReference> NetworkInterfaces { get; set; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\compute\Azure.ResourceManager.Compute\src\Generated\Models\NetworkProfile.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.ResourceManager.Compute.Models
 13{
 14    public partial class NetworkProfile : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 24418            writer.WriteStartObject();
 24419            if (NetworkInterfaces != null)
 20            {
 24421                writer.WritePropertyName("networkInterfaces");
 24422                writer.WriteStartArray();
 100823                foreach (var item in NetworkInterfaces)
 24                {
 26025                    writer.WriteObjectValue(item);
 26                }
 24427                writer.WriteEndArray();
 28            }
 24429            writer.WriteEndObject();
 24430        }
 31
 32        internal static NetworkProfile DeserializeNetworkProfile(JsonElement element)
 33        {
 43234            IList<NetworkInterfaceReference> networkInterfaces = default;
 172835            foreach (var property in element.EnumerateObject())
 36            {
 43237                if (property.NameEquals("networkInterfaces"))
 38                {
 43239                    if (property.Value.ValueKind == JsonValueKind.Null)
 40                    {
 41                        continue;
 42                    }
 43243                    List<NetworkInterfaceReference> array = new List<NetworkInterfaceReference>();
 176044                    foreach (var item in property.Value.EnumerateArray())
 45                    {
 44846                        if (item.ValueKind == JsonValueKind.Null)
 47                        {
 048                            array.Add(null);
 49                        }
 50                        else
 51                        {
 44852                            array.Add(NetworkInterfaceReference.DeserializeNetworkInterfaceReference(item));
 53                        }
 54                    }
 43255                    networkInterfaces = array;
 56                    continue;
 57                }
 58            }
 43259            return new NetworkProfile(networkInterfaces);
 60        }
 61    }
 62}