< Summary

Class:Azure.ResourceManager.Resources.Models.Location
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Location.cs
C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Location.Serialization.cs
Covered lines:37
Uncovered lines:10
Coverable lines:47
Total lines:131
Line coverage:78.7% (37 of 47)
Covered branches:22
Total branches:26
Branch coverage:84.6% (22 of 26)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Id()-100%100%
get_SubscriptionId()-0%100%
get_Name()-100%100%
get_DisplayName()-100%100%
get_RegionalDisplayName()-0%100%
get_Metadata()-100%100%
DeserializeLocation(...)-80.65%84.62%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Location.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.Resources.Models
 9{
 10    /// <summary> Location information. </summary>
 11    public partial class Location
 12    {
 13        /// <summary> Initializes a new instance of Location. </summary>
 014        internal Location()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of Location. </summary>
 19        /// <param name="id"> The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-000
 20        /// <param name="subscriptionId"> The subscription ID. </param>
 21        /// <param name="name"> The location name. </param>
 22        /// <param name="displayName"> The display name of the location. </param>
 23        /// <param name="regionalDisplayName"> The display name of the location and its region. </param>
 24        /// <param name="metadata"> Metadata of the location, such as lat/long, paired region, and others. </param>
 825        internal Location(string id, string subscriptionId, string name, string displayName, string regionalDisplayName,
 26        {
 827            Id = id;
 828            SubscriptionId = subscriptionId;
 829            Name = name;
 830            DisplayName = displayName;
 831            RegionalDisplayName = regionalDisplayName;
 832            Metadata = metadata;
 833        }
 34
 35        /// <summary> The fully qualified ID of the location. For example, /subscriptions/00000000-0000-0000-0000-000000
 436        public string Id { get; }
 37        /// <summary> The subscription ID. </summary>
 038        public string SubscriptionId { get; }
 39        /// <summary> The location name. </summary>
 440        public string Name { get; }
 41        /// <summary> The display name of the location. </summary>
 442        public string DisplayName { get; }
 43        /// <summary> The display name of the location and its region. </summary>
 044        public string RegionalDisplayName { get; }
 45        /// <summary> Metadata of the location, such as lat/long, paired region, and others. </summary>
 846        public LocationMetadata Metadata { get; }
 47    }
 48}

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\Models\Location.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.Resources.Models
 12{
 13    public partial class Location
 14    {
 15        internal static Location DeserializeLocation(JsonElement element)
 16        {
 817            string id = default;
 818            string subscriptionId = default;
 819            string name = default;
 820            string displayName = default;
 821            string regionalDisplayName = default;
 822            LocationMetadata metadata = default;
 8023            foreach (var property in element.EnumerateObject())
 24            {
 3225                if (property.NameEquals("id"))
 26                {
 827                    if (property.Value.ValueKind == JsonValueKind.Null)
 28                    {
 29                        continue;
 30                    }
 831                    id = property.Value.GetString();
 832                    continue;
 33                }
 2434                if (property.NameEquals("subscriptionId"))
 35                {
 036                    if (property.Value.ValueKind == JsonValueKind.Null)
 37                    {
 38                        continue;
 39                    }
 040                    subscriptionId = property.Value.GetString();
 041                    continue;
 42                }
 2443                if (property.NameEquals("name"))
 44                {
 845                    if (property.Value.ValueKind == JsonValueKind.Null)
 46                    {
 47                        continue;
 48                    }
 849                    name = property.Value.GetString();
 850                    continue;
 51                }
 1652                if (property.NameEquals("displayName"))
 53                {
 854                    if (property.Value.ValueKind == JsonValueKind.Null)
 55                    {
 56                        continue;
 57                    }
 858                    displayName = property.Value.GetString();
 859                    continue;
 60                }
 861                if (property.NameEquals("regionalDisplayName"))
 62                {
 063                    if (property.Value.ValueKind == JsonValueKind.Null)
 64                    {
 65                        continue;
 66                    }
 067                    regionalDisplayName = property.Value.GetString();
 068                    continue;
 69                }
 870                if (property.NameEquals("metadata"))
 71                {
 872                    if (property.Value.ValueKind == JsonValueKind.Null)
 73                    {
 74                        continue;
 75                    }
 876                    metadata = LocationMetadata.DeserializeLocationMetadata(property.Value);
 77                    continue;
 78                }
 79            }
 880            return new Location(id, subscriptionId, name, displayName, regionalDisplayName, metadata);
 81        }
 82    }
 83}