< Summary

Information
Class: CounterpointCollective.Dataflow.Encapsulation.LinkToExtensions
Assembly: Dataflow.Fluent
File(s): /builds/counterpointcollective/composabledataflowblocks/Source/Dataflow.Fluent/Dataflow/Encapsulation/LinkToExtensions.cs
Line coverage
88%
Covered lines: 8
Uncovered lines: 1
Coverable lines: 9
Total lines: 28
Line coverage: 88.8%
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 Crap Score Cyclomatic complexity Line coverage
LinkToWithCustomCompletion(...)100%11100%
.ctor(...)100%11100%
get_Completion()100%210%
Complete()100%11100%
Fault(...)100%11100%
OfferMessage(...)100%11100%

File(s)

/builds/counterpointcollective/composabledataflowblocks/Source/Dataflow.Fluent/Dataflow/Encapsulation/LinkToExtensions.cs

#LineLine coverage
 1using CounterpointCollective.Dataflow.Internal;
 2using System;
 3using System.Threading.Tasks;
 4using System.Threading.Tasks.Dataflow;
 5
 6namespace CounterpointCollective.Dataflow.Encapsulation
 7{
 8    /// <exclude />
 9    public static class LinkToExtensions
 10    {
 11        public static IDisposable LinkToWithCustomCompletion<T>(this ISourceBlock<T> s, Task customCompletion, ITargetBl
 54712            => s.LinkTo(
 54713                new TargetWrapper<T>(customCompletion, target),
 54714                options
 54715            );
 16
 54717        private class TargetWrapper<T>(Task customCompletion, ITargetBlock<T> target) : ITargetBlock<T>
 18        {
 019            public Task Completion => target.Completion;
 20
 2321            public void Complete() => customCompletion.PropagateCompletion(target);
 622            public void Fault(Exception exception) => customCompletion.PropagateCompletion(target);
 23            public DataflowMessageStatus OfferMessage(DataflowMessageHeader messageHeader, T messageValue, ISourceBlock<
 20087824                => target.OfferMessage(messageHeader, messageValue, source, consumeToAccept);
 25
 26        }
 27    }
 28}