forked from tsai/mathnet-numerics
14 changed files with 70 additions and 89 deletions
Binary file not shown.
@ -0,0 +1,22 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> |
||||
|
<metadata> |
||||
|
<id>FsUnit</id> |
||||
|
<version>1.2.1.0</version> |
||||
|
<title>FsUnit</title> |
||||
|
<authors>Ray Vernagus and Daniel Mohl</authors> |
||||
|
<owners>Ray Vernagus and Daniel Mohl</owners> |
||||
|
<licenseUrl>http://fsunit.codeplex.com/license</licenseUrl> |
||||
|
<projectUrl>http://fsunit.codeplex.com/</projectUrl> |
||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance> |
||||
|
<description>FsUnit is a set of extensions that add special testing syntax to NUnit.</description> |
||||
|
<summary>The goals of FsUnit are to make unit-testing feel more functional while leverage existing testing frameworks.</summary> |
||||
|
<releaseNotes /> |
||||
|
<copyright /> |
||||
|
<language>en-US</language> |
||||
|
<tags>F# fsharp NUnit FsUnit</tags> |
||||
|
<dependencies> |
||||
|
<dependency id="NUnit" version="2.6.2" /> |
||||
|
</dependencies> |
||||
|
</metadata> |
||||
|
</package> |
||||
Binary file not shown.
Binary file not shown.
@ -0,0 +1,3 @@ |
|||||
|
param($rootPath, $toolsPath, $package, $project) |
||||
|
|
||||
|
Add-BindingRedirect $project.Name |
||||
@ -1,11 +1,13 @@ |
|||||
<?xml version="1.0" encoding="utf-8" ?> |
<?xml version="1.0" encoding="utf-8" ?> |
||||
<configuration> |
<configuration> |
||||
<runtime> |
<runtime> |
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
<dependentAssembly> |
<dependentAssembly> |
||||
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
<bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" /> |
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0" /> |
||||
</dependentAssembly> |
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.3.0.0" /> |
||||
</assemblyBinding> |
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.3.0.0" /> |
||||
</runtime> |
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
</configuration> |
</configuration> |
||||
|
|||||
@ -1,4 +1,5 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<packages> |
<packages> |
||||
|
<package id="FsUnit" version="1.2.1.0" targetFramework="net45" /> |
||||
<package id="NUnit" version="2.6.2" targetFramework="net45" /> |
<package id="NUnit" version="2.6.2" targetFramework="net45" /> |
||||
</packages> |
</packages> |
||||
@ -0,0 +1,13 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8" ?> |
||||
|
<configuration> |
||||
|
<runtime> |
||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> |
||||
|
<dependentAssembly> |
||||
|
<assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> |
||||
|
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.3.0.0" /> |
||||
|
<bindingRedirect oldVersion="2.3.5.0" newVersion="4.3.0.0" /> |
||||
|
<bindingRedirect oldVersion="2.0.0.0" newVersion="4.3.0.0" /> |
||||
|
</dependentAssembly> |
||||
|
</assemblyBinding> |
||||
|
</runtime> |
||||
|
</configuration> |
||||
@ -1,70 +0,0 @@ |
|||||
module FsUnit |
|
||||
open NUnit.Framework |
|
||||
open NUnit.Framework.Constraints |
|
||||
|
|
||||
let should (f : 'a -> #Constraint) x (y : obj) = |
|
||||
let c = f x |
|
||||
let y = |
|
||||
match y with |
|
||||
| :? (unit -> unit) -> box (TestDelegate(y :?> unit -> unit)) |
|
||||
| _ -> y |
|
||||
Assert.That(y, c) |
|
||||
|
|
||||
let equal x = EqualConstraint(x) |
|
||||
|
|
||||
let equalWithin tolerance x = equal(x).Within tolerance |
|
||||
|
|
||||
let contain x = ContainsConstraint(x) |
|
||||
|
|
||||
let haveLength n = Has.Length.EqualTo(n) |
|
||||
|
|
||||
let haveCount n = Has.Count.EqualTo(n) |
|
||||
|
|
||||
let be = id |
|
||||
|
|
||||
let Null = NullConstraint() |
|
||||
|
|
||||
let Empty = EmptyConstraint() |
|
||||
|
|
||||
let EmptyString = EmptyStringConstraint() |
|
||||
|
|
||||
let NullOrEmptyString = NullOrEmptyStringConstraint() |
|
||||
|
|
||||
let True = TrueConstraint() |
|
||||
|
|
||||
let False = FalseConstraint() |
|
||||
|
|
||||
let sameAs x = SameAsConstraint(x) |
|
||||
|
|
||||
let throw = Throws.TypeOf |
|
||||
|
|
||||
let greaterThan x = GreaterThanConstraint(x) |
|
||||
|
|
||||
let greaterThanOrEqualTo x = GreaterThanOrEqualConstraint(x) |
|
||||
|
|
||||
let lessThan x = LessThanConstraint(x) |
|
||||
|
|
||||
let lessThanOrEqualTo x = LessThanOrEqualConstraint(x) |
|
||||
|
|
||||
let shouldFail (f : unit -> unit) = |
|
||||
TestDelegate(f) |> should throw typeof<AssertionException> |
|
||||
|
|
||||
let endWith (s:string) = EndsWithConstraint s |
|
||||
|
|
||||
let startWith (s:string) = StartsWithConstraint s |
|
||||
|
|
||||
let ofExactType<'a> = ExactTypeConstraint(typeof<'a>) |
|
||||
|
|
||||
let instanceOfType<'a> = InstanceOfTypeConstraint(typeof<'a>) |
|
||||
|
|
||||
let NaN = NaNConstraint() |
|
||||
|
|
||||
let unique = UniqueItemsConstraint() |
|
||||
|
|
||||
let not' x = NotConstraint(x) |
|
||||
|
|
||||
let array_equal = equal |
|
||||
let array2_equal = equal |
|
||||
let approximately_equal tolerance = equalWithin (10.0 ** (float -tolerance)) |
|
||||
let approximately_vector_equal = approximately_equal |
|
||||
let approximately_matrix_equal = approximately_equal |
|
||||
@ -1,4 +1,5 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<packages> |
<packages> |
||||
|
<package id="FsUnit" version="1.2.1.0" targetFramework="net40" /> |
||||
<package id="NUnit" version="2.6.2" targetFramework="net40" /> |
<package id="NUnit" version="2.6.2" targetFramework="net40" /> |
||||
</packages> |
</packages> |
||||
Loading…
Reference in new issue