question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

FsCheck.Xunit doesn't support C# async tests

See original GitHub issue

With a test like:

[Property]
public async Task TestWhatever(int i)
{
    Assert.True(await DoSomething(i));
}

The Xunit runner fails with:

 System.Exception:
 No instances of class FsCheck.Testable+Testable`1[a] for type System.Threading.Tasks.Task

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:31 (22 by maintainers)

github_iconTop GitHub Comments

4reactions
kurtschelfthoutcommented, Jun 11, 2021

I think it’s fine to use it - I’ve been considering getting 3.0 out pretty much as is, and moving all the long term stuff to a subsequent version.

1reaction
kurtschelfthoutcommented, Sep 26, 2017

This is now in pre-release in NuGet in 3.0-alpha1: https://www.nuget.org/packages/FsCheck/3.0.0-alpha1

Please try it out and open new issues in case of problems.

Read more comments on GitHub >

github_iconTop Results From Across the Web

xUnit Async Test Not Working Properly
The problem is that async void method does not return a Task object which xUnit could possibly examine for exceptions.
Read more >
List of unit testing frameworks
Code-driven unit testing frameworks for various programming languages are as follows. Some, but not all, are based on xUnit. ... Fixtures: Indicates whether...
Read more >
Running tests - FsCheck
An FsCheck test fails from xUnit.NET's perspective if it finds a counter-example, or if the arguments are exhausted. It passes when FsCheck can...
Read more >
What I wish I knew when learning F#
As described above, Async's are not evaluated until run whereas Tasks in most uses are immediately started (just like Promises and Futures in ......
Read more >
A restaurant example of refactoring from example-based to ...
A restaurant example of refactoring from example-based to property-based testing by Mark Seemann. A C# example with xUnit.net and FsCheck.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found