MiniCoverAliases Class

Summary

Contains functionality related to MiniCover.

In order to use the commands for this alias, create a tools project and use the Cake.MiniCover.MiniCoverAliases.SetMiniCoverToolsProject(Cake.Core.ICakeContext,Cake.Core.IO.FilePath) alias.

Assembly
Cake.MiniCover.dll
Namespace
Cake.MiniCover
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["MiniCoverAliases"] class Type type-node

Syntax

public static class MiniCoverAliases

Examples

SetMiniCoverToolsProject("./minicover/minicover.csproj");
MiniCover(tool =>
    {
        foreach(var project in GetFiles("./test/**/*.csproj"))
        {
            tool.DotNetCoreTest(project.FullPath, new DotNetCoreTestSettings()
            {
                // Required to keep instrumentation added by MiniCover
                NoBuild = true,
                Configuration = configuration
            });
        }
    },
    new MiniCoverSettings()
        .WithAssembliesMatching("./test/**/*.dll")
        .WithSourcesMatching("./src/**/*.cs")
        .GenerateReport(ReportType.CONSOLE | ReportType.XML)
);
SetMiniCoverToolsProject("./minicover/minicover.csproj");
MiniCoverInstrument(
    new MiniCoverSettings()
        .WithAssembliesMatching("./test/**/*.dll")
        .WithSourcesMatching("./src/**/*.cs")
);
MiniCoverReset();
DotNetCoreTest(...);
MiniCoverUninstrument();
MiniCoverReport(new MiniCoverSettings().GenerateReport(ReportType.CONSOLE | ReportType.XML));

Attributes

Type Description
CakeAliasCategoryAttribute
CakeNamespaceImportAttribute
CakeNamespaceImportAttribute

Methods

Name Value Summary
MiniCover(ICakeContext, Action<ICakeContext>, MiniCoverSettings) void
Instruments test assemblies using MiniCover before executing the specified test action to generate code coverage.
static
MiniCoverInstrument(ICakeContext, MiniCoverSettings) void
Instrument the specified assemblies to gather coverage data
static
MiniCoverInstrument(ICakeContext) void
Instrument the specified assemblies to gather coverage data
static
MiniCoverReport(ICakeContext, MiniCoverSettings, string, Action<ProcessArgumentBuilder>) void
Generate a report using the specified report provider name. Only use this if if you need to generate a report for which Cake.MiniCover does not yet have settings for.
static
MiniCoverReport(ICakeContext, MiniCoverSettings, string) void
Generate a report using the specified report provider name. Only use this if if you need to generate a report for which Cake.MiniCover does not yet have settings for.
static
MiniCoverReport(ICakeContext, MiniCoverSettings) void
Generate one or more minicover reports
static
MiniCoverReset(ICakeContext, MiniCoverSettings) void
Reset coverage for the minicover project identified by the provided settings
static
MiniCoverReset(ICakeContext) void
Reset coverage for the minicover project identified by the provided settings
static
MiniCoverUninstrument(ICakeContext, MiniCoverSettings) void
Uninstrument the assemblies that were instrumented for code coverage
static
MiniCoverUninstrument(ICakeContext) void
Uninstrument the assemblies that were instrumented for code coverage
static
SetMiniCoverToolsProject(ICakeContext, FilePath) void
Set the location of the 'csproj' that contains the MiniCover DotNetCliToolReference and restore packages for it
static

Extension Methods

Name Value Summary
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin
ToStringWithNullMarkup() string
Returns the string value or a Not set> markup suitable for Spectre.Console.
Requires the Cake.Issues addin