visualstudio.xunit icon indicating copy to clipboard operation
visualstudio.xunit copied to clipboard

False positives with ValueTasks

Open Yeah69 opened this issue 3 years ago • 0 comments

In order to quickly demonstrate the issue and compare with other unit testing frameworks, I've created example tests: https://github.com/Yeah69/AsyncTesting However, this issue caused me confusion in unit test that I created for a concrete project. So it isn't just a theoretical issue for me.

The false positive tests are: https://github.com/Yeah69/AsyncTesting/blob/e371f20073035f267f95c0f4a708186ef38f70e0/AsyncTesting.xUnit/Tests.cs#L38-L43 https://github.com/Yeah69/AsyncTesting/blob/e371f20073035f267f95c0f4a708186ef38f70e0/AsyncTesting.xUnit/Tests.cs#L98-L104

Here you can see the results and comparison with the other unit testing frameworks: image

MSTest doesn't seem to support the ValueTask-Tests at all. NUnit seems to do everything right. Unfortunately xUnit has the false positives.

Yeah69 avatar Sep 29 '22 19:09 Yeah69