Mechanic
Mechanic copied to clipboard
Unit Test Library
Shall we have a discussion on unit testing libraries? @forki mentioned Expecto
in the readme. I haven't used it but I'd be keen it to give it a try. Thoughts?
I am familiar with Expecto
and like using it with Unquote
for the assertions. I would like to use it in this project.
I've used FsCheck.Xunit
with great success too; Mark Seemann has an excellent collections of blog posts that introduce FsCheck and solves many common scenarios. But I don't really have any strong opinions.
If we want to use Expecto
, some work might be needed in the test project to connect all the dots and make the tests execute and report results correctly.
@tlycken FsCheck is something I'd definitely recommend on this project - it'll catch many corner cases that we won't think of naturally.
I really like using Xunit
and Unquote
, especially for VS; it integrated nicely with test explorer; however, I'm not sure how good the experience is if you don't use VS. I never used Expecto
but I'd be interested in trying something new.
FWIW, I think the decision should be up to whoever starts implementing some tests. If you're about to start working on something, use whatever you feel comfortable with.
And if you're not first on the ball, but dislike what you find, you can always submit an issue and/or PR to discuss the relative merits of whatever you're unhappy with vs whatever you want to replace it with.
So far there's been a couple of discussions around what tool chain to use for testing, and several people have vouched for Xunit, Expecto, FsCheck and Unquote; anything using a combination of some of these has a very high probability of being accepted by all. That doesn't mean that these are the only options, though - anything that runs from dotnet test
is fine by me.
Expecto has a VS test runner add in as well AFAIK.
This seems to be the best way to run Expecto through dotnet test
: https://github.com/YoloDev/YoloDev.Expecto.TestSdk
Expecto has VS adapter https://github.com/adamchester/expecto-adapter