Skip to content

Commit d66eaab

Browse files
committed
Changed UseConsoleOutput boolean to ReporterOutputType enum
1 parent d1c56cf commit d66eaab

File tree

8 files changed

+14
-8
lines changed

8 files changed

+14
-8
lines changed

src/coverlet.console/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int Main(string[] args)
7272
if (reporter == null)
7373
throw new Exception($"Specified output format '{format}' is not supported");
7474

75-
if (reporter.UseConsoleOutput)
75+
if (reporter.OutputType == ReporterOutputType.Console)
7676
{
7777
// Output to console
7878
logger.LogInformation(" Outputting results to console");

src/coverlet.core/Reporters/CoberturaReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace Coverlet.Core.Reporters
1010
{
1111
public class CoberturaReporter : IReporter
1212
{
13-
public bool UseConsoleOutput => false;
13+
public ReporterOutputType OutputType => ReporterOutputType.File;
1414

1515
public string Format => "cobertura";
1616

src/coverlet.core/Reporters/IReporter.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ namespace Coverlet.Core.Reporters
22
{
33
public interface IReporter
44
{
5-
bool UseConsoleOutput { get; }
5+
ReporterOutputType OutputType { get; }
66
string Format { get; }
77
string Extension { get; }
88
string Report(CoverageResult result);
99
}
10+
11+
public enum ReporterOutputType
12+
{
13+
File,
14+
Console,
15+
}
1016
}

src/coverlet.core/Reporters/JsonReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ namespace Coverlet.Core.Reporters
44
{
55
public class JsonReporter : IReporter
66
{
7-
public bool UseConsoleOutput => false;
7+
public ReporterOutputType OutputType => ReporterOutputType.File;
88

99
public string Format => "json";
1010

src/coverlet.core/Reporters/LcovReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace Coverlet.Core.Reporters
66
{
77
public class LcovReporter : IReporter
88
{
9-
public bool UseConsoleOutput => false;
9+
public ReporterOutputType OutputType => ReporterOutputType.File;
1010

1111
public string Format => "lcov";
1212

src/coverlet.core/Reporters/OpenCoverReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ namespace Coverlet.Core.Reporters
99
{
1010
public class OpenCoverReporter : IReporter
1111
{
12-
public bool UseConsoleOutput => false;
12+
public ReporterOutputType OutputType => ReporterOutputType.File;
1313

1414
public string Format => "opencover";
1515

src/coverlet.core/Reporters/TeamCityReporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace coverlet.core.Reporters
66
{
77
public class TeamCityReporter : IReporter
88
{
9-
public bool UseConsoleOutput => true;
9+
public ReporterOutputType OutputType => ReporterOutputType.Console;
1010

1111
public string Format => "teamcity";
1212

src/coverlet.msbuild.tasks/CoverageResultTask.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public override bool Execute()
6565
if (reporter == null)
6666
throw new Exception($"Specified output format '{format}' is not supported");
6767

68-
if (reporter.UseConsoleOutput)
68+
if (reporter.OutputType == ReporterOutputType.Console)
6969
{
7070
// Output to console
7171
Console.WriteLine(" Outputting results to console");

0 commit comments

Comments
 (0)