< Summary

Information
Class: Elsa.Testing.Shared.CombinedTextWriter
Assembly: Elsa.Testing.Shared
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared/CombinedTextWriter.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 8
Coverable lines: 8
Total lines: 25
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 Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%210%
.ctor(...)100%210%
get_Encoding()100%210%
Write(...)0%620%
Dispose(...)0%620%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Testing.Shared/CombinedTextWriter.cs

#LineLine coverage
 1using System.Text;
 2
 3namespace Elsa.Testing.Shared;
 4
 5/// <summary>
 6/// Forwards text to the specified list of writers.
 7/// </summary>
 8public class CombinedTextWriter : TextWriter
 9{
 10    private readonly IEnumerable<TextWriter> _targets;
 011    public CombinedTextWriter(IEnumerable<TextWriter> targets) => _targets = targets;
 012    public CombinedTextWriter(params TextWriter[] targets) => _targets = targets;
 013    public override Encoding Encoding => Console.Out.Encoding;
 14
 15    public override void Write(char value)
 16    {
 017        foreach (var target in _targets) target.Write(value);
 018    }
 19
 20    protected override void Dispose(bool disposing)
 21    {
 022        foreach (var target in _targets) target.Dispose();
 023        base.Dispose(disposing);
 024    }
 25}