Changed UseConsoleOutput boolean to ReporterOutputType enum

This commit is contained in:
Justin Robb
2018-11-13 10:43:14 -08:00
parent d1c56cf281
commit d66eaab4c6
8 changed files with 14 additions and 8 deletions
+1 -1
View File
@@ -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";
+7 -1
View File
@@ -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,
}
}
+1 -1
View File
@@ -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";
+1 -1
View File
@@ -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");