< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.Configuration.RabbitMqQuorumQueueXArgument
Assembly: CoreWCF.RabbitMQ
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.RabbitMQ/src/CoreWCF/Channels/Configuration/QuorumQueueConfiguration.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 90
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.cctor()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    {
 111        public static readonly string DeliveryLimit = "x-delivery-limit";
 12    }
 13
 14    public class QuorumQueueConfiguration : QueueDeclareConfiguration
 15    {
 16        private int _deliveryLimit = 3;
 17
 18        public override string QueueType => RabbitMqQueueType.Quorum;
 19
 20        public override bool Durable
 21        {
 22            get
 23            {
 24                return true;
 25            }
 26            set
 27            {
 28                if (!value)
 29                {
 30                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(Durable), false
 31                }
 32            }
 33        }
 34
 35        public override bool Exclusive
 36        {
 37            get
 38            {
 39                return false;
 40            }
 41            set
 42            {
 43                if (value)
 44                {
 45                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(Exclusive), tru
 46                }
 47            }
 48        }
 49
 50        public override bool GlobalQosPrefetch
 51        {
 52            get
 53            {
 54                return false;
 55            }
 56            set
 57            {
 58                if (value)
 59                {
 60                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(GlobalQosPrefet
 61                }
 62            }
 63        }
 64
 65        public int DeliveryLimit
 66        {
 67            get
 68            {
 69                return _deliveryLimit;
 70            }
 71            set
 72            {
 73                if (value < 1)
 74                {
 75                    throw new ArgumentException(SR.Format(SR.UnsupportedQuorumQueuePropertyValue, nameof(DeliveryLimit),
 76                }
 77
 78                _deliveryLimit = value;
 79            }
 80        }
 81
 82        internal override Dictionary<string, object> ToDictionary()
 83        {
 84            var queueXArgs = base.ToDictionary();
 85            queueXArgs[RabbitMqQuorumQueueXArgument.DeliveryLimit] = DeliveryLimit;
 86
 87            return queueXArgs;
 88        }
 89    }
 90}

Methods/Properties

.cctor()