Mechanic icon indicating copy to clipboard operation
Mechanic copied to clipboard

Unit Test Library

Open donopj2 opened this issue 7 years ago • 8 comments

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?

donopj2 avatar Jan 04 '18 23:01 donopj2

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

fbehrens avatar Jan 05 '18 00:01 fbehrens

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.

tomasaschan avatar Jan 05 '18 15:01 tomasaschan

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

isaacabraham avatar Jan 06 '18 21:01 isaacabraham

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.

swrhim avatar Jan 07 '18 00:01 swrhim

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.

tomasaschan avatar Jan 07 '18 07:01 tomasaschan

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

isaacabraham avatar Jan 07 '18 09:01 isaacabraham

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

tomasaschan avatar Jan 08 '18 21:01 tomasaschan

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

AlexTroshkin avatar Jan 11 '18 09:01 AlexTroshkin