< Summary

Class:Azure.ResourceManager.Resources.Models.LocationMetadata
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\LocationMetadata.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\LocationMetadata.Serialization.cs
Covered lines:31
Uncovered lines:28
Coverable lines:59
Total lines:160
Line coverage:52.5% (31 of 59)
Covered branches:18
Total branches:34
Branch coverage:52.9% (18 of 34)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_RegionType()-0%100%
get_RegionCategory()-0%100%
get_GeographyGroup()-0%100%
get_Longitude()-100%100%
get_Latitude()-100%100%
get_PhysicalLocation()-0%100%
get_PairedRegion()-0%100%
DeserializeLocationMetadata(...)-48.78%52.94%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\LocationMetadata.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.Resources.Models
 11{
 12    /// <summary> Location metadata information. </summary>
 13    public partial class LocationMetadata
 14    {
 15        /// <summary> Initializes a new instance of LocationMetadata. </summary>
 016        internal LocationMetadata()
 17        {
 018        }
 19
 20        /// <summary> Initializes a new instance of LocationMetadata. </summary>
 21        /// <param name="regionType"> The type of the region. </param>
 22        /// <param name="regionCategory"> The category of the region. </param>
 23        /// <param name="geographyGroup"> The geography group of the location. </param>
 24        /// <param name="longitude"> The longitude of the location. </param>
 25        /// <param name="latitude"> The latitude of the location. </param>
 26        /// <param name="physicalLocation"> The physical location of the Azure location. </param>
 27        /// <param name="pairedRegion"> The regions paired to this region. </param>
 828        internal LocationMetadata(RegionType? regionType, RegionCategory? regionCategory, string geographyGroup, string 
 29        {
 830            RegionType = regionType;
 831            RegionCategory = regionCategory;
 832            GeographyGroup = geographyGroup;
 833            Longitude = longitude;
 834            Latitude = latitude;
 835            PhysicalLocation = physicalLocation;
 836            PairedRegion = pairedRegion;
 837        }
 38
 39        /// <summary> The type of the region. </summary>
 040        public RegionType? RegionType { get; }
 41        /// <summary> The category of the region. </summary>
 042        public RegionCategory? RegionCategory { get; }
 43        /// <summary> The geography group of the location. </summary>
 044        public string GeographyGroup { get; }
 45        /// <summary> The longitude of the location. </summary>
 446        public string Longitude { get; }
 47        /// <summary> The latitude of the location. </summary>
 448        public string Latitude { get; }
 49        /// <summary> The physical location of the Azure location. </summary>
 050        public string PhysicalLocation { get; }
 51        /// <summary> The regions paired to this region. </summary>
 052        public IReadOnlyList<PairedRegion> PairedRegion { get; }
 53    }
 54}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\LocationMetadata.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.Resources.Models
 13{
 14    public partial class LocationMetadata
 15    {
 16        internal static LocationMetadata DeserializeLocationMetadata(JsonElement element)
 17        {
 818            RegionType? regionType = default;
 819            RegionCategory? regionCategory = default;
 820            string geographyGroup = default;
 821            string longitude = default;
 822            string latitude = default;
 823            string physicalLocation = default;
 824            IReadOnlyList<PairedRegion> pairedRegion = default;
 4825            foreach (var property in element.EnumerateObject())
 26            {
 1627                if (property.NameEquals("regionType"))
 28                {
 029                    if (property.Value.ValueKind == JsonValueKind.Null)
 30                    {
 31                        continue;
 32                    }
 033                    regionType = new RegionType(property.Value.GetString());
 034                    continue;
 35                }
 1636                if (property.NameEquals("regionCategory"))
 37                {
 038                    if (property.Value.ValueKind == JsonValueKind.Null)
 39                    {
 40                        continue;
 41                    }
 042                    regionCategory = new RegionCategory(property.Value.GetString());
 043                    continue;
 44                }
 1645                if (property.NameEquals("geographyGroup"))
 46                {
 047                    if (property.Value.ValueKind == JsonValueKind.Null)
 48                    {
 49                        continue;
 50                    }
 051                    geographyGroup = property.Value.GetString();
 052                    continue;
 53                }
 1654                if (property.NameEquals("longitude"))
 55                {
 856                    if (property.Value.ValueKind == JsonValueKind.Null)
 57                    {
 58                        continue;
 59                    }
 860                    longitude = property.Value.GetString();
 861                    continue;
 62                }
 863                if (property.NameEquals("latitude"))
 64                {
 865                    if (property.Value.ValueKind == JsonValueKind.Null)
 66                    {
 67                        continue;
 68                    }
 869                    latitude = property.Value.GetString();
 870                    continue;
 71                }
 072                if (property.NameEquals("physicalLocation"))
 73                {
 074                    if (property.Value.ValueKind == JsonValueKind.Null)
 75                    {
 76                        continue;
 77                    }
 078                    physicalLocation = property.Value.GetString();
 079                    continue;
 80                }
 081                if (property.NameEquals("pairedRegion"))
 82                {
 083                    if (property.Value.ValueKind == JsonValueKind.Null)
 84                    {
 85                        continue;
 86                    }
 087                    List<PairedRegion> array = new List<PairedRegion>();
 088                    foreach (var item in property.Value.EnumerateArray())
 89                    {
 090                        if (item.ValueKind == JsonValueKind.Null)
 91                        {
 092                            array.Add(null);
 93                        }
 94                        else
 95                        {
 096                            array.Add(Models.PairedRegion.DeserializePairedRegion(item));
 97                        }
 98                    }
 099                    pairedRegion = array;
 100                    continue;
 101                }
 102            }
 8103            return new LocationMetadata(regionType, regionCategory, geographyGroup, longitude, latitude, physicalLocatio
 104        }
 105    }
 106}