FsCheck icon indicating copy to clipboard operation
FsCheck copied to clipboard

Support MS Test 2

Open xperiandri opened this issue 8 years ago • 11 comments

{
  "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"
      ]
    }
  }
}

xperiandri avatar Jan 14 '17 16:01 xperiandri

What doesn't work here? You should be able to use one of the portable FsCheck version.

kurtschelfthout avatar Jan 14 '17 20:01 kurtschelfthout

Even Property attribute?

xperiandri avatar Jan 14 '17 21:01 xperiandri

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.

kurtschelfthout avatar Jan 15 '17 11:01 kurtschelfthout

It is related. But my issue is about MS Test Framework 2 support.

xperiandri avatar Jan 15 '17 19:01 xperiandri

Like I said, afaik MSTest has no extension points.

kurtschelfthout avatar Jan 15 '17 19:01 kurtschelfthout

Since I don't really see how to support the wish here because of how MSTest works, I'm closing this.

kurtschelfthout avatar Feb 04 '17 10:02 kurtschelfthout

@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.

lukas-lansky avatar Jan 04 '18 09:01 lukas-lansky

Sure.

kurtschelfthout avatar Jan 04 '18 20:01 kurtschelfthout

@lukas-lansky do you have anything to present to the community?

xperiandri avatar Apr 15 '20 13:04 xperiandri

Is it possible on context of v3.0 release?

xperiandri avatar Sep 05 '21 22:09 xperiandri

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.

kurtschelfthout avatar Sep 06 '21 07:09 kurtschelfthout

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.

Andreas-Dorfer avatar Oct 26 '22 12:10 Andreas-Dorfer

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

kurtschelfthout avatar Oct 27 '22 07:10 kurtschelfthout