-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Labels
Description
Description
I just wrote some tests and wanted to test a collection that has the equivalent item than another.
Could you please implement the collection constraints from NUnit?
Repro steps
I have to use NUnit's function with like:
let areCollectionsEqual = CollectionAssert.AreEquivalent([1;2;3], [3;1;2])
It's not so "F#-ish".
Known workarounds
I "extended" FsUnit with an extra function:
module FsUnit =
open NUnit.Framework.Constraints
let equalsToCollection x = CollectionEquivalentConstraint x
So I can use this function like:
let areCollectionsEqual () = [1;2;3] |> should equalsToCollection [3;1;2]
Collection contraints implemented:
- equivalent
- supersetOf
- subsetOf