< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%100%
get_Country()-0%100%
get_State()-0%100%
get_City()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeAzureReachabilityReportLocation(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureReachabilityReportLocation.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> Parameters that define a geographic location. </summary>
 13    public partial class AzureReachabilityReportLocation
 14    {
 15        /// <summary> Initializes a new instance of AzureReachabilityReportLocation. </summary>
 16        /// <param name="country"> The name of the country. </param>
 017        public AzureReachabilityReportLocation(string country)
 18        {
 019            if (country == null)
 20            {
 021                throw new ArgumentNullException(nameof(country));
 22            }
 23
 024            Country = country;
 025        }
 26
 27        /// <summary> Initializes a new instance of AzureReachabilityReportLocation. </summary>
 28        /// <param name="country"> The name of the country. </param>
 29        /// <param name="state"> The name of the state. </param>
 30        /// <param name="city"> The name of the city or town. </param>
 031        internal AzureReachabilityReportLocation(string country, string state, string city)
 32        {
 033            Country = country;
 034            State = state;
 035            City = city;
 036        }
 37
 38        /// <summary> The name of the country. </summary>
 039        public string Country { get; set; }
 40        /// <summary> The name of the state. </summary>
 041        public string State { get; set; }
 42        /// <summary> The name of the city or town. </summary>
 043        public string City { get; set; }
 44    }
 45}

C:\Git\azure-sdk-for-net\sdk\network\Azure.ResourceManager.Network\src\Generated\Models\AzureReachabilityReportLocation.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 AzureReachabilityReportLocation : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("country");
 019            writer.WriteStringValue(Country);
 020            if (State != null)
 21            {
 022                writer.WritePropertyName("state");
 023                writer.WriteStringValue(State);
 24            }
 025            if (City != null)
 26            {
 027                writer.WritePropertyName("city");
 028                writer.WriteStringValue(City);
 29            }
 030            writer.WriteEndObject();
 031        }
 32
 33        internal static AzureReachabilityReportLocation DeserializeAzureReachabilityReportLocation(JsonElement element)
 34        {
 035            string country = default;
 036            string state = default;
 037            string city = default;
 038            foreach (var property in element.EnumerateObject())
 39            {
 040                if (property.NameEquals("country"))
 41                {
 042                    country = property.Value.GetString();
 043                    continue;
 44                }
 045                if (property.NameEquals("state"))
 46                {
 047                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 051                    state = property.Value.GetString();
 052                    continue;
 53                }
 054                if (property.NameEquals("city"))
 55                {
 056                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 060                    city = property.Value.GetString();
 61                    continue;
 62                }
 63            }
 064            return new AzureReachabilityReportLocation(country, state, city);
 65        }
 66    }
 67}