< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.ServiceModel.Channels.RabbitMqTransportBindingElement
Assembly: CoreWCF.RabbitMQ.Client
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.RabbitMQ.Client/src/CoreWCF/ServiceModel/Channels/RabbitMqTransportBindingElement.cs
Line coverage
90%
Covered lines: 18
Uncovered lines: 2
Coverable lines: 20
Total lines: 79
Line coverage: 90%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor()100%11100%
.ctor(...)100%11100%
Clone()100%11100%
GetProperty(...)50%2266.66%
BuildChannelFactory(...)50%2266.66%
CanBuildChannelFactory(...)100%11100%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.RabbitMQ.Client/src/CoreWCF/ServiceModel/Channels/RabbitMqTransportBindingElement.cs

#LineLine coverage
 1using System;
 2using System.ServiceModel.Channels;
 3using RabbitMQ.Client;
 4
 5namespace CoreWCF.ServiceModel.Channels
 6{
 7    public class RabbitMqTransportBindingElement : TransportBindingElement
 8    {
 39        public RabbitMqTransportBindingElement()
 310        { }
 11
 12        private RabbitMqTransportBindingElement(RabbitMqTransportBindingElement other)
 1513            : base(other)
 14        {
 1515            MaxReceivedMessageSize = other.MaxReceivedMessageSize;
 1516            BrokerProtocol = other.BrokerProtocol;
 1517            SslOption = other.SslOption;
 1518            VirtualHost = other.VirtualHost;
 1519        }
 20
 21        /// <summary>
 22        /// Gets the scheme used by the binding, soap.amqp
 23        /// </summary>
 24        public override string Scheme
 25        {
 926            get { return RabbitMqDefaults.Scheme; }
 27        }
 28
 29        /// <summary>
 30        /// Specifies the version of the AMQP protocol that should be used to
 31        /// communicate with the broker
 32        /// </summary>
 4833        public IProtocol BrokerProtocol { get; set; } = Protocols.DefaultProtocol;
 34
 35        /// <summary>
 36        /// SSL configuration for the RabbitMQ queue
 37        /// </summary>
 3638        public SslOption SslOption { get; set; }
 39
 40        /// <summary>
 41        /// Virtual host for the RabbitMQ queue
 42        /// </summary>
 3643        public string VirtualHost { get; set; }
 44
 45        public override BindingElement Clone()
 46        {
 1547            return new RabbitMqTransportBindingElement(this);
 48        }
 49
 50        public override T GetProperty<T>(BindingContext context)
 51        {
 952            if (context == null)
 53            {
 054                throw new ArgumentNullException(nameof(context));
 55            }
 56
 957            return context.GetInnerProperty<T>();
 58        }
 59
 60        public override IChannelFactory<TChannel> BuildChannelFactory<TChannel>(BindingContext context)
 61        {
 362            if (context == null)
 63            {
 064                throw new ArgumentNullException(nameof(context));
 65            }
 66
 367            return (IChannelFactory<TChannel>)new RabbitMqChannelFactory(this, context);
 68        }
 69
 70        /// <summary>
 71        /// Used by higher layers to determine what types of channel factories this
 72        /// binding element supports. Which in this case is just IOutputChannel.
 73        /// </summary>
 74        public override bool CanBuildChannelFactory<TChannel>(BindingContext context)
 75        {
 376            return typeof(TChannel) == typeof(IOutputChannel);
 77        }
 78    }
 79}