< Summary

Class:Azure.Messaging.ServiceBus.Management.TrueRuleFilter
Assembly:Azure.Messaging.ServiceBus
File(s):C:\Git\azure-sdk-for-net\sdk\servicebus\Azure.Messaging.ServiceBus\src\Management\Rules\TrueRuleFilter.cs
Covered lines:5
Uncovered lines:9
Coverable lines:14
Total lines:83
Line coverage:35.7% (5 of 14)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.cctor()-100%100%
.ctor()-100%100%
Clone()-100%100%
ToString()-0%100%
GetHashCode()-0%100%
Equals(...)-0%100%
Equals(...)-100%100%
op_Equality(...)-0%0%
op_Inequality(...)-0%100%

File(s)

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

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4namespace Azure.Messaging.ServiceBus.Management
 5{
 6    /// <summary>
 7    /// Matches all the messages arriving to be selected for the subscription.
 8    /// </summary>
 9    public sealed class TrueRuleFilter : SqlRuleFilter
 10    {
 211        internal static readonly TrueRuleFilter Default = new TrueRuleFilter();
 12
 13        /// <summary>
 14        /// Initializes a new instance of the <see cref="TrueRuleFilter" /> class.
 15        /// </summary>
 16        public TrueRuleFilter()
 2617            : base("1=1")
 18        {
 2619        }
 20
 21        internal override RuleFilter Clone() =>
 822            new TrueRuleFilter();
 23
 24        /// <summary>
 25        /// Converts the value of the current instance to its equivalent string representation.
 26        /// </summary>
 27        /// <returns>A string representation of the current instance.</returns>
 28        public override string ToString()
 29        {
 030            return "TrueRuleFilter";
 31        }
 32
 33        /// <inheritdoc/>
 34        public override int GetHashCode()
 35        {
 036            return base.GetHashCode();
 37        }
 38
 39        /// <inheritdoc/>
 40        public override bool Equals(object obj)
 41        {
 042            return obj is TrueRuleFilter;
 43        }
 44
 45        /// <inheritdoc/>
 46        public override bool Equals(RuleFilter other)
 47        {
 848            return other is TrueRuleFilter;
 49        }
 50
 51        /// <summary>
 52        ///
 53        /// </summary>
 54        /// <param name="left"></param>
 55        /// <param name="right"></param>
 56        /// <returns></returns>
 57        public static bool operator ==(TrueRuleFilter left, TrueRuleFilter right)
 58        {
 059            if (ReferenceEquals(left, right))
 60            {
 061                return true;
 62            }
 63
 064            if (ReferenceEquals(left, null) || ReferenceEquals(right, null))
 65            {
 066                return false;
 67            }
 68
 069            return left.Equals(right);
 70        }
 71
 72        /// <summary>
 73        ///
 74        /// </summary>
 75        /// <param name="left"></param>
 76        /// <param name="right"></param>
 77        /// <returns></returns>
 78        public static bool operator !=(TrueRuleFilter left, TrueRuleFilter right)
 79        {
 080            return !(left == right);
 81        }
 82    }
 83}