Skip to content

Commit

Permalink
Merge pull request #89 from sergey-tihon/master
Browse files Browse the repository at this point in the history
Migration to NUnit 3.2
  • Loading branch information
sergey-tihon committed Mar 6, 2016
2 parents bab42de + 877aec6 commit bcd19fe
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 20 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2.1.0 - March 7, 2016
* Added support of `NUnit 3.2`
* Added pretty-print for F# value types - https://github.com/fsprojects/FsUnit/pull/89

### 2.0.0 - February 8, 2016
* Added support of `NUnit 3` - https://github.com/fsprojects/FsUnit/pull/83
* Dropped support of obsolete `not` operator
Expand Down
1 change: 1 addition & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Target "NUnit" (fun _ ->
!! "tests/**/bin/Release/*NUnit.Test.dll"
|> NUnit3 (fun p ->
{ p with
Labels = LabelsLevel.All
TimeOut = TimeSpan.FromMinutes 20.})
)

Expand Down
12 changes: 12 additions & 0 deletions docs/content/NUnit.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ FsUnit for NUnit
<div class="span1"></div>
</div>
If you reference `FsUnit` from `NuGet` and want to use pretty-printed F# value types in error messages,
you have to add following piece of code to your assembly:
*)

open FsUnit

type InitMsgUtils() =
inherit FSharpCustomMessageFormatter()

(**
Euler - Problem 1
-----------------
*)
Expand Down
2 changes: 1 addition & 1 deletion paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ nuget SourceLink.Fake
nuget FSharp.Core 3.1.2.5
nuget Microsoft.VisualStudio.QualityTools.UnitTestFramework

nuget NHamcrest 1.2.1
nuget NHamcrest
nuget xunit
nuget xunit.runner.console
nuget xunit.runner.visualstudio
Expand Down
32 changes: 21 additions & 11 deletions paket.lock
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
NUGET
remote: https://www.nuget.org/api/v2
specs:
FAKE (4.17.1)
FSharp.Compiler.Service (1.4.2.3)
FAKE (4.21.4)
FSharp.Compiler.Service (2.0.0.6)
FSharp.Core (3.1.2.5)
FSharp.Formatting (2.13.5)
FSharp.Compiler.Service (>= 1.4.2 < 1.5.0)
FSharpVSPowerTools.Core (>= 2.2.0 < 2.3.0)
FSharpVSPowerTools.Core (2.2.0)
FSharp.Compiler.Service (>= 1.4.2.0)
FSharp.Formatting (2.14.0)
FSharp.Compiler.Service (>= 2.0.0.3 < 2.1.0)
FSharpVSPowerTools.Core (>= 2.3.0 < 2.4.0)
FSharpVSPowerTools.Core (2.3.0)
FSharp.Compiler.Service (>= 2.0.0.3)
mbunit (3.4.14)
Microsoft.Bcl (1.1.10)
Microsoft.Bcl.Build (>= 1.0.14)
Expand All @@ -18,9 +18,19 @@ NUGET
Microsoft.Bcl.Build (>= 1.0.14)
Microsoft.VisualStudio.QualityTools.UnitTestFramework (11.0.50727.1)
NHamcrest (1.2.1)
NUnit (3.0.1)
NUnit.Console (3.0.1)
Octokit (0.17.0)
NUnit (3.2.0)
NUnit.Console (3.2.0)
NUnit.ConsoleRunner (3.2.0)
NUnit.Extension.NUnitProjectLoader (3.2.0)
NUnit.Extension.NUnitV2Driver (3.2.0)
NUnit.Extension.NUnitV2ResultWriter (3.2.0)
NUnit.Extension.VSProjectLoader (3.2.0)
NUnit.ConsoleRunner (3.2.0)
NUnit.Extension.NUnitProjectLoader (3.2.0)
NUnit.Extension.NUnitV2Driver (3.2.0)
NUnit.Extension.NUnitV2ResultWriter (3.2.0)
NUnit.Extension.VSProjectLoader (3.2.0)
Octokit (0.18.0)
Microsoft.Net.Http
SourceLink.Fake (1.1.0)
System.Collections (4.0.10) - framework: dnxcore50
Expand Down Expand Up @@ -191,5 +201,5 @@ NUGET
GITHUB
remote: fsharp/FAKE
specs:
modules/Octokit/Octokit.fsx (e537d90b050d02cc287cb64e18b72a8b7e984805)
modules/Octokit/Octokit.fsx (e71048b08b7aefebb3adeaa4518915510d55785c)
Octokit
2 changes: 1 addition & 1 deletion src/FsUnit.MbUnit/FsUnit.MbUnit.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net20\FSharp.Core.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/FsUnit.MsTestUnit/FsUnit.MsTest.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/FsUnit.NUnit/FsUnit.NUnit.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/FsUnit.NUnit/FsUnit.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ open NUnit.Framework.Constraints
//
[<AutoOpen>]
module TopLevelOperators =

[<SetUpFixture>]
type FSharpCustomMessageFormatter() =
do TestContext.AddFormatter(
ValueFormatterFactory(fun _ -> ValueFormatter(sprintf "%A")))

let Null = NullConstraint()

let Empty = EmptyConstraint()
Expand Down
2 changes: 1 addition & 1 deletion src/FsUnit.NUnit/paket.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ summary
description
FsUnit is a set of extensions that add special testing syntax to NUnit.
dependencies
NUnit 3.0.1
NUnit 3.2.0
FSharp.Core >= 3.1.2.5
files
../../bin/FsUnit.NUnit/FsUnit.* ==> lib/net45
Expand Down
4 changes: 2 additions & 2 deletions src/FsUnit.Xunit/FsUnit.Xunit.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props" Condition="Exists('..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props')" Label="Paket" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -89,7 +90,7 @@
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll</HintPath>
<Private>False</Private>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
Expand Down Expand Up @@ -280,5 +281,4 @@
</ItemGroup>
</When>
</Choose>
<Import Project="..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props" Condition="Exists('..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props')" Label="Paket" />
</Project>
1 change: 1 addition & 0 deletions tests/FsUnit.NUnit.Test/FsUnit.NUnit.Test.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
</Choose>
<Import Project="$(FSharpTargetsPath)" Condition="Exists('$(FSharpTargetsPath)')" />
<ItemGroup>
<Compile Include="init.fs" />
<Compile Include="beAscendingTests.fs" />
<Compile Include="beDescendingTests.fs" />
<Compile Include="beChoice.fs" />
Expand Down
7 changes: 7 additions & 0 deletions tests/FsUnit.NUnit.Test/init.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace FsUnit.Test

open FsUnit

type InitMsgUtils() =
inherit FSharpCustomMessageFormatter()

4 changes: 2 additions & 2 deletions tests/FsUnit.Xunit.Test/FsUnit.Xunit.Test.fsproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props" Condition="Exists('..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props')" Label="Paket" />
<Import Project="..\..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_props).props" Condition="Exists('..\..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_props).props')" Label="Paket" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -331,7 +333,5 @@
</PropertyGroup>
</When>
</Choose>
<Import Project="..\..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_props).props" Condition="Exists('..\..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_props).props')" Label="Paket" />
<Import Project="..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props" Condition="Exists('..\..\packages\xunit.core\build\$(__paket__xunit_core_props).props')" Label="Paket" />
<Import Project="..\..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_targets).targets" Condition="Exists('..\..\packages\xunit.runner.visualstudio\build\$(__paket__xunit_runner_visualstudio_targets).targets')" Label="Paket" />
</Project>

0 comments on commit bcd19fe

Please sign in to comment.