< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.Configuration.QuorumQueueConfiguration
Assembly: CoreWCF.RabbitMQ
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.RabbitMQ/src/CoreWCF/Channels/Configuration/QuorumQueueConfiguration.cs
Line coverage
68%
Covered lines: 15
Uncovered lines: 7
Coverable lines: 22
Total lines: 90
Line coverage: 68.1%
Branch coverage
37%
Covered branches: 3
Total branches: 8
Branch coverage: 37.5%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%11100%
ToDictionary()100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.RabbitMQ/src/CoreWCF/Channels/Configuration/QuorumQueueConfiguration.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System;
 5using System.Collections.Generic;
 6
 7namespace CoreWCF.Channels.Configuration
 8{
 9    public static class RabbitMqQuorumQueueXArgument
 10    {
 11        public static readonly string DeliveryLimit = "x-delivery-limit";
 12    }
 13
 14    public class QuorumQueueConfiguration : QueueDeclareConfiguration
 15    {
 816        private int _deliveryLimit = 3;
 17
 418        public override string QueueType => RabbitMqQueueType.Quorum;
 19
 20        public override bool Durable
 21        {
 22            get
 23            {
 324                return true;
 25            }
 26            set
 27            {
 128                if (!value)
 29                {
 130                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(Durable), false
 31                }
 032            }
 33        }
 34
 35        public override bool Exclusive
 36        {
 37            get
 38            {
 339                return false;
 40            }
 41            set
 42            {
 143                if (value)
 44                {
 145                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(Exclusive), tru
 46                }
 047            }
 48        }
 49
 50        public override bool GlobalQosPrefetch
 51        {
 52            get
 53            {
 354                return false;
 55            }
 56            set
 57            {
 158                if (value)
 59                {
 160                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(GlobalQosPrefet
 61                }
 062            }
 63        }
 64
 65        public int DeliveryLimit
 66        {
 67            get
 68            {
 369                return _deliveryLimit;
 70            }
 71            set
 72            {
 073                if (value < 1)
 74                {
 075                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(DeliveryLimit),
 76                }
 77
 078                _deliveryLimit = value;
 079            }
 80        }
 81
 82        internal override Dictionary<string, object> ToDictionary()
 83        {
 384            var queueXArgs = base.ToDictionary();
 385            queueXArgs[RabbitMqQuorumQueueXArgument.DeliveryLimit] = DeliveryLimit;
 86
 387            return queueXArgs;
 88        }
 89    }
 90}