< Summary

Class:Azure.ResourceManager.EventHubs.Models.CheckNameAvailabilityResult
Assembly:Azure.ResourceManager.EventHubs
File(s):C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\CheckNameAvailabilityResult.cs
C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\CheckNameAvailabilityResult.Serialization.cs
Covered lines:20
Uncovered lines:6
Coverable lines:26
Total lines:89
Line coverage:76.9% (20 of 26)
Covered branches:13
Total branches:14
Branch coverage:92.8% (13 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-100%100%
get_Message()-0%100%
get_NameAvailable()-100%100%
get_Reason()-0%100%
DeserializeCheckNameAvailabilityResult(...)-87.5%92.86%

File(s)

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\CheckNameAvailabilityResult.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.EventHubs.Models
 9{
 10    /// <summary> The Result of the CheckNameAvailability operation. </summary>
 11    public partial class CheckNameAvailabilityResult
 12    {
 13        /// <summary> Initializes a new instance of CheckNameAvailabilityResult. </summary>
 014        internal CheckNameAvailabilityResult()
 15        {
 016        }
 17
 18        /// <summary> Initializes a new instance of CheckNameAvailabilityResult. </summary>
 19        /// <param name="message"> The detailed info regarding the reason associated with the Namespace. </param>
 20        /// <param name="nameAvailable"> Value indicating Namespace is availability, true if the Namespace is available;
 21        /// <param name="reason"> The reason for unavailability of a Namespace. </param>
 1622        internal CheckNameAvailabilityResult(string message, bool? nameAvailable, UnavailableReason? reason)
 23        {
 1624            Message = message;
 1625            NameAvailable = nameAvailable;
 1626            Reason = reason;
 1627        }
 28
 29        /// <summary> The detailed info regarding the reason associated with the Namespace. </summary>
 030        public string Message { get; }
 31        /// <summary> Value indicating Namespace is availability, true if the Namespace is available; otherwise, false. 
 832        public bool? NameAvailable { get; }
 33        /// <summary> The reason for unavailability of a Namespace. </summary>
 034        public UnavailableReason? Reason { get; }
 35    }
 36}

C:\Git\azure-sdk-for-net\sdk\eventhub\Azure.ResourceManager.EventHubs\src\Generated\Models\CheckNameAvailabilityResult.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.EventHubs.Models
 12{
 13    public partial class CheckNameAvailabilityResult
 14    {
 15        internal static CheckNameAvailabilityResult DeserializeCheckNameAvailabilityResult(JsonElement element)
 16        {
 1617            string message = default;
 1618            bool? nameAvailable = default;
 1619            UnavailableReason? reason = default;
 10420            foreach (var property in element.EnumerateObject())
 21            {
 3622                if (property.NameEquals("message"))
 23                {
 424                    if (property.Value.ValueKind == JsonValueKind.Null)
 25                    {
 26                        continue;
 27                    }
 028                    message = property.Value.GetString();
 029                    continue;
 30                }
 3231                if (property.NameEquals("nameAvailable"))
 32                {
 1633                    if (property.Value.ValueKind == JsonValueKind.Null)
 34                    {
 35                        continue;
 36                    }
 1637                    nameAvailable = property.Value.GetBoolean();
 1638                    continue;
 39                }
 1640                if (property.NameEquals("reason"))
 41                {
 1642                    if (property.Value.ValueKind == JsonValueKind.Null)
 43                    {
 44                        continue;
 45                    }
 1646                    reason = property.Value.GetString().ToUnavailableReason();
 47                    continue;
 48                }
 49            }
 1650            return new CheckNameAvailabilityResult(message, nameAvailable, reason);
 51        }
 52    }
 53}