Skip to content

Commit

Permalink
Added tests to verify argument generation for NUnitDomainModel
Browse files Browse the repository at this point in the history
  • Loading branch information
andersosthus committed Aug 3, 2015
1 parent 9d5dee2 commit b7e14b8
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 0 deletions.
90 changes: 90 additions & 0 deletions src/test/Test.FAKECore/NunitCommonSpecs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
using System;
using Fake;
using FSharp.Testing;
using Machine.Specifications;

namespace Test.FAKECore.NunitCommonSpecs
{
[Subject(typeof(NUnitCommon), "runner argument construction")]
internal abstract class BuildArgumentsSpecsBase
{
protected static NUnitCommon.NUnitParams Parameters;
protected static string[] Assemblies;
protected static string Arguments;

Establish context = () =>
{
Parameters = NUnitCommon.NUnitDefaults;
Assemblies = new[] { "test.dll", "other.dll" };
};

Because of = () =>
{
Arguments = NUnitCommon.buildNUnitdArgs(Parameters, Assemblies);
Console.WriteLine(Arguments);
};
}

internal class When_using_the_default_parameters
: BuildArgumentsSpecsBase
{
It should_not_disable_shadow_copy =
() => Arguments.ShouldNotContain("-noshadow");
It should_not_exclude_category =
() => Arguments.ShouldNotContain("-exclude:");
It should_not_include_category =
() => Arguments.ShouldNotContain("-include:");
It should_not_select_app_domain =
() => Arguments.ShouldNotContain("-domain:");
It should_not_show_logo =
() => Arguments.ShouldContain("-nologo");
It should_not_specify_error_out_file =
() => Arguments.ShouldNotContain("-err:");
It should_not_specify_fixture =
() => Arguments.ShouldNotContain("-fixture:");
It should_not_specify_framework =
() => Arguments.ShouldNotContain("-framework:");
It should_not_specify_out_file =
() => Arguments.ShouldNotContain("-out:");
It should_not_specify_process_model =
() => Arguments.ShouldNotContain("-process:");
It should_not_specify_xslt_transform_file =
() => Arguments.ShouldNotContain("-transform:");
It should_not_stop_on_error =
() => Arguments.ShouldNotContain("-stoponerror");
It should_not_test_in_new_thread =
() => Arguments.ShouldNotContain("-nothread");
It should_show_labels =
() => Arguments.ShouldContain("-labels");
}

internal class When_requesting_no_app_domain
: BuildArgumentsSpecsBase
{
Establish context =
() => Parameters = Parameters.With(p => p.Domain, NUnitCommon.NUnitDomainModel.NoDomainModel);

It should_request_no_app_domain =
() => Arguments.ShouldContain("-domain:None");
}

internal class When_requesting_single_app_domain
: BuildArgumentsSpecsBase
{
Establish context =
() => Parameters = Parameters.With(p => p.Domain, NUnitCommon.NUnitDomainModel.SingleDomainModel);

It should_request_single_app_domain =
() => Arguments.ShouldContain("-domain:Single");
}

internal class When_requesting_multiple_app_domains
: BuildArgumentsSpecsBase
{
Establish context =
() => Parameters = Parameters.With(p => p.Domain, NUnitCommon.NUnitDomainModel.MultipleDomainModel);

It should_request_multiple_app_domains =
() => Arguments.ShouldContain("-domain:Multiple");
}
}
1 change: 1 addition & 0 deletions src/test/Test.FAKECore/Test.FAKECore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
<Compile Include="Globbing\TestSample5\AbsoluteDirGlobbingSpecs.cs" />
<Compile Include="NAVFiles\NAVSplitObjectSpecs.cs" />
<Compile Include="NAVFiles\NavTestResultSpecs.cs" />
<Compile Include="NunitCommonSpecs.cs" />
<Compile Include="OpenCoverHelperSpecs.cs" />
<Compile Include="PackageMgt\PackagesConfigSpecs.cs" />
<Compile Include="SemVerHelperSpecs.cs" />
Expand Down

0 comments on commit b7e14b8

Please sign in to comment.