< Summary - CoreWCF Coverage — PR #1766

Information
Class: CoreWCF.Channels.MsmqReceiveContext
Assembly: CoreWCF.MSMQ
File(s): /home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.MSMQ/src/CoreWCF/Channels/MsmqReceiveContext.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 11
Coverable lines: 11
Total lines: 40
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 4
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
.ctor(...)100%110%
OnAbandonAsync()0%440%
OnCompleteAsync()100%110%

File(s)

/home/runner/work/CoreWCF/CoreWCF/src/CoreWCF.MSMQ/src/CoreWCF/Channels/MsmqReceiveContext.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.Threading;
 6using System.Threading.Tasks;
 7using CoreWCF.Queue.Common;
 8
 9namespace CoreWCF.Channels
 10{
 11    internal class MsmqReceiveContext : ReceiveContext
 12    {
 13        private readonly QueueMessageContext _queueMessageContext;
 14        private readonly DeadLetterQueueSender _deadLetterQueueSender;
 15
 016        public MsmqReceiveContext(QueueMessageContext queueMessageContext, DeadLetterQueueSender deadLetterQueueSender)
 17        {
 018            _queueMessageContext = queueMessageContext;
 019            _deadLetterQueueSender = deadLetterQueueSender;
 020        }
 21
 22        protected override async Task OnAbandonAsync(CancellationToken token)
 23        {
 024            if (_queueMessageContext.QueueTransportContext.ServiceDispatcher.Binding is NetMsmqBinding binding &&
 025                binding.DeadLetterQueue == DeadLetterQueue.Custom)
 26            {
 027                await _deadLetterQueueSender.Send(_queueMessageContext.QueueMessageReader, binding.CustomDeadLetterQueue
 28            }
 29            else
 30            {
 031                await _deadLetterQueueSender.SendToSystem(_queueMessageContext.QueueMessageReader, _queueMessageContext.
 32            }
 033        }
 34
 35        protected override async Task OnCompleteAsync(CancellationToken token)
 036        {
 37            // Do nothing
 038        }
 39    }
 40}