I would like to be about to use a list, array, and/or seq as a parameter to xUnit\'s InlineData.
In C# I can do this:
using Xunit; //2.1.0
namespace C
One possibility is to use xUnit's MemberData attribute. A disadvantage with this approach is that this parameterized test appears in Visual Studio's Test Explorer as one test instead of two separate tests because collections lack xUnit's IXunitSerializable interface and xUnit hasn't added build-in serialization support for that type either. See xunit/xunit/issues/429 for more information.
Here is a minimal working example.
module TestModule
open Xunit
type TestType () =
static member TestProperty
with get() : obj[] list =
[
[| [0]; "a" |]
[| [1;2]; "b" |]
]
[]
[]
member __.TestMethod (a:int list) (b:string) =
Assert.Equal(1, a.Length)
See also this similar question in which I give a similar answer.