Skip to content

Commit

Permalink
Try to use FsCheck
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Mar 17, 2016
1 parent dcb1341 commit aff4dde
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 1 deletion.
1 change: 1 addition & 0 deletions paket.dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ group Test

nuget NUnit.Runners.Net4
nuget NUnit ~> 2
nuget FSCheck
github forki/FsUnit FsUnit.fs
3 changes: 3 additions & 0 deletions paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ GROUP Test
NUGET
remote: https://www.nuget.org/api/v2
specs:
FsCheck (2.2.4)
FSharp.Core (>= 3.1.2.5)
FSharp.Core (4.0.0.1)
NUnit (2.6.4)
NUnit.Runners.Net4 (2.6.4)
GITHUB
Expand Down
41 changes: 40 additions & 1 deletion tests/Paket.Tests/Paket.Tests.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
</Content>
<Content Include="Nuspec\LiteGuard.Source.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</Content>
<Content Include="Nuspec\EasyNetQ.nuspec">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
Expand Down Expand Up @@ -226,6 +226,7 @@
<Compile Include="Resolver\GlobalPessimisticStrategySpecs.fs" />
<Compile Include="Resolver\GlobalOptimisticStrategySpecs.fs" />
<Compile Include="Resolver\StrategySpecs.fs" />
<Compile Include="Resolver\PropertyTests.fs" />
<Compile Include="Lockfile\GeneratorSpecs.fs" />
<Compile Include="Lockfile\GenerateWithOptionsSpecs.fs" />
<Compile Include="Lockfile\GenerateAuthModeSpecs.fs" />
Expand Down Expand Up @@ -419,6 +420,44 @@
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6' Or $(TargetFrameworkVersion) == 'v4.6.1')">
<ItemGroup>
<Reference Include="FsCheck">
<HintPath>..\..\packages\test\FsCheck\lib\net45\FsCheck.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch') Or ($(TargetFrameworkIdentifier) == 'Xamarin.iOS') Or ($(TargetFrameworkIdentifier) == 'Xamarin.Mac') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">
<ItemGroup>
<Reference Include="FsCheck">
<HintPath>..\..\packages\test\FsCheck\lib\portable-net45+netcore45\FsCheck.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78')">
<ItemGroup>
<Reference Include="FsCheck">
<HintPath>..\..\packages\test\FsCheck\lib\portable-net45+netcore45+wp8\FsCheck.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile259')">
<ItemGroup>
<Reference Include="FsCheck">
<HintPath>..\..\packages\test\FsCheck\lib\portable-net45+netcore45+wpa81+wp8\FsCheck.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\packages\test\NUnit\lib\nunit.framework.dll</HintPath>
Expand Down
15 changes: 15 additions & 0 deletions tests/Paket.Tests/Resolver/PropertyTests.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module Resovler.PropertyTests

open Paket
open NUnit.Framework
open FsUnit
open TestHelpers
open Paket.Domain
open Paket.PackageResolver
open FsCheck


[<Test>]
let ``sound check`` () =
let p xs = List.rev (List.rev xs) = xs
Check.QuickThrowOnFailure p
1 change: 1 addition & 0 deletions tests/Paket.Tests/paket.references
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ Chessie
group Test
NUnit
NUnit.Runners.Net4
FsCheck
File:FsUnit.fs .

0 comments on commit aff4dde

Please sign in to comment.