< Summary

Information
Class: CounterpointCollective.Dataflow.ChoiceBlock<T1, T2>
Assembly: Dataflow.Composable
File(s): /builds/counterpointcollective/composabledataflowblocks/Source/Dataflow.Composable/DataFlow/ChoiceBlock.cs
Line coverage
78%
Covered lines: 11
Uncovered lines: 3
Coverable lines: 14
Total lines: 36
Line coverage: 78.5%
Branch coverage
50%
Covered branches: 1
Total branches: 2
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)50%22100%
get_BoundedCapacity()100%210%
set_BoundedCapacity(...)100%210%
get_Count()100%210%
get_TargetSide()100%11100%
get_SourceSide()100%11100%

File(s)

/builds/counterpointcollective/composabledataflowblocks/Source/Dataflow.Composable/DataFlow/ChoiceBlock.cs

#LineLine coverage
 1using CounterpointCollective.Dataflow.Encapsulation;
 2using System.Threading.Tasks.Dataflow;
 3
 4namespace CounterpointCollective.Dataflow
 5{
 6    public class ChoiceBlock<TInput, TOutput>
 7        : AbstractEncapsulatedPropagatorBlock<TInput, TOutput>
 8        , IResizablePropagatorBlock<TInput, TOutput>
 9    {
 10        private readonly IResizablePropagatorBlock<TInput, TOutput> _innerBlock;
 11
 112        public ChoiceBlock(
 113            Predicate<TInput> predicate,
 114            IPropagatorBlock<TInput, TOutput> thenBlock,
 115            IPropagatorBlock<TInput, TOutput> elseBlock,
 116            ExecutionDataflowBlockOptions options
 217        ) => _innerBlock =
 118                options.EnsureOrdered
 119                ? new OrderPreservingChoiceBlock<TInput, TOutput>(predicate, thenBlock, elseBlock, options)
 120                : new NonOrderPreservingChoiceBlock<TInput, TOutput>(predicate, thenBlock, elseBlock, options);
 21
 22        public int BoundedCapacity
 23        {
 024            get => _innerBlock.BoundedCapacity;
 025            set => _innerBlock.BoundedCapacity = value;
 26        }
 27
 028        public int Count => _innerBlock.Count;
 29
 30        /// <exclude/>
 10000131        protected override ITargetBlock<TInput> TargetSide => _innerBlock;
 32
 33        /// <exclude/>
 10000434        protected override ISourceBlock<TOutput> SourceSide => _innerBlock;
 35    }
 36}