Changed UseConsoleOutput boolean to ReporterOutputType enum
This commit is contained in:
@@ -72,7 +72,7 @@ namespace Coverlet.Console
|
||||
if (reporter == null)
|
||||
throw new Exception($"Specified output format '{format}' is not supported");
|
||||
|
||||
if (reporter.UseConsoleOutput)
|
||||
if (reporter.OutputType == ReporterOutputType.Console)
|
||||
{
|
||||
// Output to console
|
||||
logger.LogInformation(" Outputting results to console");
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Coverlet.Core.Reporters
|
||||
{
|
||||
public class CoberturaReporter : IReporter
|
||||
{
|
||||
public bool UseConsoleOutput => false;
|
||||
public ReporterOutputType OutputType => ReporterOutputType.File;
|
||||
|
||||
public string Format => "cobertura";
|
||||
|
||||
|
||||
@@ -2,9 +2,15 @@ namespace Coverlet.Core.Reporters
|
||||
{
|
||||
public interface IReporter
|
||||
{
|
||||
bool UseConsoleOutput { get; }
|
||||
ReporterOutputType OutputType { get; }
|
||||
string Format { get; }
|
||||
string Extension { get; }
|
||||
string Report(CoverageResult result);
|
||||
}
|
||||
|
||||
public enum ReporterOutputType
|
||||
{
|
||||
File,
|
||||
Console,
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ namespace Coverlet.Core.Reporters
|
||||
{
|
||||
public class JsonReporter : IReporter
|
||||
{
|
||||
public bool UseConsoleOutput => false;
|
||||
public ReporterOutputType OutputType => ReporterOutputType.File;
|
||||
|
||||
public string Format => "json";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Coverlet.Core.Reporters
|
||||
{
|
||||
public class LcovReporter : IReporter
|
||||
{
|
||||
public bool UseConsoleOutput => false;
|
||||
public ReporterOutputType OutputType => ReporterOutputType.File;
|
||||
|
||||
public string Format => "lcov";
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Coverlet.Core.Reporters
|
||||
{
|
||||
public class OpenCoverReporter : IReporter
|
||||
{
|
||||
public bool UseConsoleOutput => false;
|
||||
public ReporterOutputType OutputType => ReporterOutputType.File;
|
||||
|
||||
public string Format => "opencover";
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace coverlet.core.Reporters
|
||||
{
|
||||
public class TeamCityReporter : IReporter
|
||||
{
|
||||
public bool UseConsoleOutput => true;
|
||||
public ReporterOutputType OutputType => ReporterOutputType.Console;
|
||||
|
||||
public string Format => "teamcity";
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace Coverlet.MSbuild.Tasks
|
||||
if (reporter == null)
|
||||
throw new Exception($"Specified output format '{format}' is not supported");
|
||||
|
||||
if (reporter.UseConsoleOutput)
|
||||
if (reporter.OutputType == ReporterOutputType.Console)
|
||||
{
|
||||
// Output to console
|
||||
Console.WriteLine(" Outputting results to console");
|
||||
|
||||
Reference in New Issue
Block a user