< Summary

Class:Azure.Messaging.ServiceBus.Management.MessagingSku
Assembly:Azure.Messaging.ServiceBus
File(s):C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Management\MessagingSku.cs
Covered lines:3
Uncovered lines:9
Coverable lines:12
Total lines:80
Line coverage:25% (3 of 12)
Covered branches:1
Total branches:6
Branch coverage:16.6% (1 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-100%50%
get_Basic()-0%100%
get_Standard()-0%100%
get_Premium()-0%100%
op_Equality(...)-0%100%
op_Inequality(...)-0%100%
op_Implicit(...)-100%100%
Equals(...)-0%0%
Equals(...)-0%100%
GetHashCode()-0%0%
ToString()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Management\MessagingSku.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System;
 5using System.ComponentModel;
 6
 7namespace Azure.Messaging.ServiceBus.Management
 8{
 9    /// <summary>
 10    /// Specifies the SKU/tier of the messaging namespace.
 11    /// </summary>
 12    public readonly struct MessagingSku : IEquatable<MessagingSku>
 13    {
 14        internal const string BasicValue = "Basic";
 15        internal const string StandardValue = "Standard";
 16        internal const string PremiumValue = "Premium";
 17
 18        private readonly string _value;
 19
 20        /// <summary>
 21        /// Initializes a new instance of the <see cref="MessagingSku"/> structure.
 22        /// </summary>
 23        /// <param name="value">The string value of the instance.</param>
 24        public MessagingSku(string value)
 25        {
 426            _value = value ?? throw new ArgumentNullException(nameof(value));
 427        }
 28
 29        /// <summary>
 30        ///  Basic namespace. Shared Resource. Only queues are available.
 31        /// </summary>
 032        public static MessagingSku Basic { get; } = new MessagingSku(BasicValue);
 33
 34        /// <summary>
 35        /// Standard namespace. Shared Resource. Queues and topics.
 36        /// </summary>
 037        public static MessagingSku Standard { get; } = new MessagingSku(StandardValue);
 38
 39        /// <summary>
 40        /// Premium namespace. Dedicated Resource. Queues and topics.
 41        /// </summary>
 042        public static MessagingSku Premium { get; } = new MessagingSku(PremiumValue);
 43
 44        /// <summary>
 45        /// Determines if two <see cref="MessagingSku"/> values are the same.
 46        /// </summary>
 47        /// <param name="left">The first <see cref="MessagingSku"/> to compare.</param>
 48        /// <param name="right">The second <see cref="MessagingSku"/> to compare.</param>
 49        /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are the same; otherwise, false.</retur
 050        public static bool operator ==(MessagingSku left, MessagingSku right) => left.Equals(right);
 51
 52        /// <summary>
 53        /// Determines if two <see cref="MessagingSku"/> values are different.
 54        /// </summary>
 55        /// <param name="left">The first <see cref="MessagingSku"/> to compare.</param>
 56        /// <param name="right">The second <see cref="MessagingSku"/> to compare.</param>
 57        /// <returns>True if <paramref name="left"/> and <paramref name="right"/> are different; otherwise, false.</retu
 058        public static bool operator !=(MessagingSku left, MessagingSku right) => !left.Equals(right);
 59
 60        /// <summary>
 61        /// Converts a string to a <see cref="MessagingSku"/>.
 62        /// </summary>
 63        /// <param name="value">The string value to convert.</param>
 464        public static implicit operator MessagingSku(string value) => new MessagingSku(value);
 65
 66        /// <inheritdoc/>
 67        [EditorBrowsable(EditorBrowsableState.Never)]
 068        public override bool Equals(object obj) => obj is MessagingSku other && Equals(other);
 69
 70        /// <inheritdoc/>
 071        public bool Equals(MessagingSku other) => string.Equals(_value, other._value, StringComparison.Ordinal);
 72
 73        /// <inheritdoc/>
 74        [EditorBrowsable(EditorBrowsableState.Never)]
 075        public override int GetHashCode() => _value?.GetHashCode() ?? 0;
 76
 77        /// <inheritdoc/>
 078        public override string ToString() => _value;
 79    }
 80}