fsprojects / Mechanic

MIT License
68 stars 17 forks source link

Unit Test Library #34

Open donopj2 opened 6 years ago

donopj2 commented 6 years ago

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?

fbehrens commented 6 years ago

I am familiar with Expecto and like using it with Unquote for the assertions. I would like to use it in this project.

tomasaschan commented 6 years ago

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.

isaacabraham commented 6 years ago

@tlycken FsCheck is something I'd definitely recommend on this project - it'll catch many corner cases that we won't think of naturally.

swrhim commented 6 years ago

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.

tomasaschan commented 6 years ago

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.

isaacabraham commented 6 years ago

Expecto has a VS test runner add in as well AFAIK.

tomasaschan commented 6 years ago

This seems to be the best way to run Expecto through dotnet test: https://github.com/YoloDev/YoloDev.Expecto.TestSdk

AlexTroshkin commented 6 years ago

Expecto has VS adapter https://github.com/adamchester/expecto-adapter