FsCheck
FsCheck copied to clipboard
Support MS Test 2
{
"version": "1.0.0-*",
"testRunner": "mstest",
"dependencies": {
"MSTest.TestAdapter": "1.1.8-rc",
"MSTest.TestFramework": "1.0.8-rc",
"Microsoft.NETCore.App": {
"version": "1.1.0",
"type": "platform"
},
"dotnet-test-mstest": "1.1.2-preview",
},
"frameworks": {
"netcoreapp1.1": {
"imports": [
"dnxcore50",
"portable-net45+win8"
]
}
}
}
What doesn't work here? You should be able to use one of the portable FsCheck version.
Even Property
attribute?
No, but last time that was looked at mstest just doesn't support that kind of extensibility. You're better of using ThrowOnFailure
.
Has this changed in MSTest 2?
If it's .NET core support you're after, that is being looked at separately: #293.
It is related. But my issue is about MS Test Framework 2 support.
Like I said, afaik MSTest has no extension points.
Since I don't really see how to support the wish here because of how MSTest works, I'm closing this.
@kurtschelfthout I noticed MSTest v2 now has https://github.com/Microsoft/testfx-docs/blob/master/RFCs/003-Customize-Running-Tests.md . I played with it yesterday and it seems to me that by writing a proper implementation for ITestMethod.Invoke
, something like FsCheck.xUnit's Property
attribute can be done for MS Test.
If you agree, can we reopen this ticket? I would like to work on this.
Sure.
@lukas-lansky do you have anything to present to the community?
Is it possible on context of v3.0 release?
It's a separate project (like FsCheck.Xunt/NUnit) so it isn't related to any particular release or version - can be added at pretty much any time. Still have no plans or intention to work on this myself though.
I wrote an MSTest extension. It started out for private use, but I recently introduced it into one of my work projects too. Works well so far, but there are open issues.
Beware that it targets .net6 only. However, feel free to open an issue if there's the need to target other framework versions.
Thanks @Andreas-Dorfer! You are most welcome to add a few lines to FsCheck's docs, e.g. here: https://github.com/fscheck/FsCheck/blob/master/docs/index.fsx#L11