Skip to content

Lanayx/FsUnit.Light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FsUnit.Light

Minimalistic version of FsUnitTyped for xUnit, NUnit ans MSTest.

It provides zero-cost abstraction over native assertions with no dependency on FsUnit. You can find some considerations in the initial issue.

Usage

1 |> shouldEqual 1 // pass
1 |> shouldNotEqual 2 // pass
[2] |> shouldContain 1 // pass
[] |> shouldNotContain 1 // pass
"Hello" |> shouldContainText "He" // pass
"Hello" |> shouldNotContainText "He" // fail
[] |> shouldBeEmpty // pass
[1] |> shouldHaveLength 1 // pass
2 |> shouldBeGreaterThan 1 // pass
1 |> shouldBeSmallerThan 2 // pass
(fun () -> null |> Array.sortInPlace) |> shouldFail<ArgumentNullException> // pass
(fun () -> failwith "error") |> shouldFailWithMessage "error" // pass
[1;2] |> shouldEquivalent [2;1] // pass
Item(Id="1") |> shouldEquivalent (Item(Id ="1")) // pass

Migration from FsUnitTyped

You need to change

open FsUnitTyped

to

open FsUnit.Light

Nuget Packages:

Framework Package
xUnit FsUnit.Light.xUnit
NUnit FsUnit.Light.NUnit
MSTest FsUnit.Light.MSTest

About

Minimalistic version of FsUnitTyped

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages