I am doing a little catch up on Unit Testing today with some of the North 51 gang. Our particular flavour of unit testing generally which goes a little something like this:
The session today is mainly a hands on session but I wanted to just keep a list of recommended links to look at afterwards and I thought it might be nice to share them with others too. The list isn't well researched and is pretty much a dump of the main things I use on a regular basis. Please comment to add more if you like!
The session today is mainly a hands on session but I wanted to just keep a list of recommended links to look at afterwards and I thought it might be nice to share them with others too. The list isn't well researched and is pretty much a dump of the main things I use on a regular basis. Please comment to add more if you like!
- Jasmine Javascript Testing Framework http://jasmine.github.io/
- QUnit https://qunitjs.com/
- Trullocks PubSub libarary https://github.com/trullock/PubSub (brilliant for decoupling Javascript concerns and also makes for some nice testable code)
- NUnit (of course)
- Moq https://github.com/Moq/moq4 my todo mocking framework if I need one
- Machine.Specifications https://github.com/machine/machine.specifications (A framework that has quite a nice syntax although I haven't used in anger for years)
- F# for testing http://fsharpforfunandprofit.com/posts/low-risk-ways-to-use-fsharp-at-work-3/
- FSUnit https://github.com/fsprojects/FsUnit
- FSCheck https://fsharp.github.io/FsCheck/ (this will blow your mind) http://www.reactiongifs.com/r/2013/10/tim-and-eric-mind-blown.gif
There's lots of other arguments that go on around unit testing such as Mocks vs Stubs etc.. etc... For the record, I find I am using Moq less and less. I have a fairly manageable amount of dependencies that are effected when I run my acceptance tests. In most cases I just swap them out with actual fake objects so for an IReadModelRepository we have an SqlReadModelRepository and we swap that out for an InMemoryReadModelRepository. In my tests I like to properly assert that the correct things were passed into those fakes. For smaller less used dependencies or for real unit tests I do still use Moq.
Comments