Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for NUnit3 --params parameter #1532

Merged
merged 1 commit into from
Apr 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/app/FakeLib/UnitTest/NUnit/NUnit3.fs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ type NUnit3Params =

/// Controls the trace logs NUnit3 will output, defaults to Off
TraceLevel : NUnit3TraceLevel

/// A test parameter specified in the form name=value. Multiple parameters may be specified, separated by semicolons
Params : string
}

/// The [NUnit3Params](fake-testing-nunit3-nunit3params.html) default parameters.
Expand All @@ -223,6 +226,7 @@ type NUnit3Params =
/// - `TeamCity` - `false`
/// - `ErrorLevel` - `Error`
/// - `TraceLevel` - `Default` (By default NUnit3 sets this to off internally)
/// - `Params` - `""`
/// ## Defaults
let NUnit3Defaults =
{
Expand All @@ -249,6 +253,7 @@ let NUnit3Defaults =
Labels = LabelsLevel.Default
ErrorLevel = NUnit3ErrorLevel.Error
TraceLevel= NUnit3TraceLevel.Default
Params = ""
}

/// Tries to detect the working directory as specified in the parameters or via TeamCity settings
Expand Down Expand Up @@ -289,6 +294,7 @@ let buildNUnit3Args parameters assemblies =
|> appendResultString parameters.ResultSpecs
|> appendIfTrue parameters.ShadowCopy "--shadowcopy"
|> appendIfTrue parameters.TeamCity "--teamcity"
|> appendIfNotNullOrEmpty parameters.Params "--params="
|> appendFileNamesIfNotNull assemblies
|> toText

Expand Down
3 changes: 2 additions & 1 deletion src/test/Test.FAKECore/NUnit3Specs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ internal class When_using_non_default_trace_parameter
NUnit3.NUnit3Defaults.TeamCity,
NUnit3.NUnit3Defaults.Labels,
NUnit3.NUnit3Defaults.ErrorLevel,
NUnit3.NUnit3TraceLevel.Verbose);
NUnit3.NUnit3TraceLevel.Verbose,
NUnit3.NUnit3Defaults.Params);
};

It should_include_the_expected_trace_argument = () =>
Expand Down