< Summary

Class:Azure.ResourceManager.Network.Models.DeviceProperties
Assembly:Azure.ResourceManager.Network
File(s):C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DeviceProperties.cs
C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DeviceProperties.Serialization.cs
Covered lines:0
Uncovered lines:38
Coverable lines:38
Total lines:110
Line coverage:0% (0 of 38)
Covered branches:0
Total branches:20
Branch coverage:0% (0 of 20)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_DeviceVendor()-0%100%
get_DeviceModel()-0%100%
get_LinkSpeedInMbps()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeDeviceProperties(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DeviceProperties.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.ResourceManager.Network.Models
 9{
 10    /// <summary> List of properties of the device. </summary>
 11    public partial class DeviceProperties
 12    {
 13        /// <summary> Initializes a new instance of DeviceProperties. </summary>
 014        public DeviceProperties()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of DeviceProperties. </summary>
 19        /// <param name="deviceVendor"> Name of the device Vendor. </param>
 20        /// <param name="deviceModel"> Model of the device. </param>
 21        /// <param name="linkSpeedInMbps"> Link speed. </param>
 022        internal DeviceProperties(string deviceVendor, string deviceModel, int? linkSpeedInMbps)
 23        {
 024            DeviceVendor = deviceVendor;
 025            DeviceModel = deviceModel;
 026            LinkSpeedInMbps = linkSpeedInMbps;
 027        }
 28
 29        /// <summary> Name of the device Vendor. </summary>
 030        public string DeviceVendor { get; set; }
 31        /// <summary> Model of the device. </summary>
 032        public string DeviceModel { get; set; }
 33        /// <summary> Link speed. </summary>
 034        public int? LinkSpeedInMbps { get; set; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\DeviceProperties.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 DeviceProperties : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            if (DeviceVendor != null)
 19            {
 020                writer.WritePropertyName("deviceVendor");
 021                writer.WriteStringValue(DeviceVendor);
 22            }
 023            if (DeviceModel != null)
 24            {
 025                writer.WritePropertyName("deviceModel");
 026                writer.WriteStringValue(DeviceModel);
 27            }
 028            if (LinkSpeedInMbps != null)
 29            {
 030                writer.WritePropertyName("linkSpeedInMbps");
 031                writer.WriteNumberValue(LinkSpeedInMbps.Value);
 32            }
 033            writer.WriteEndObject();
 034        }
 35
 36        internal static DeviceProperties DeserializeDeviceProperties(JsonElement element)
 37        {
 038            string deviceVendor = default;
 039            string deviceModel = default;
 040            int? linkSpeedInMbps = default;
 041            foreach (var property in element.EnumerateObject())
 42            {
 043                if (property.NameEquals("deviceVendor"))
 44                {
 045                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 049                    deviceVendor = property.Value.GetString();
 050                    continue;
 51                }
 052                if (property.NameEquals("deviceModel"))
 53                {
 054                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 058                    deviceModel = property.Value.GetString();
 059                    continue;
 60                }
 061                if (property.NameEquals("linkSpeedInMbps"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    linkSpeedInMbps = property.Value.GetInt32();
 68                    continue;
 69                }
 70            }
 071            return new DeviceProperties(deviceVendor, deviceModel, linkSpeedInMbps);
 72        }
 73    }
 74}