This post introduces the String Calculator kata done with AutoFixture.

A couple of weeks ago, at the Warm Crocodile conference in Copenhagen, Roy Osherove and I talked about AutoFixture and his String Calculator kata, and I decided to do the kata with AutoFixture 3 and make a series of screencasts out of it.

This series makes no particular attempt at explaining what AutoFixture is, so you might want to first acquaint yourself with some basics, such as the theory of Anonymous Variables, Derived Values, Equivalence Classes, and Constrained Non-Determinism. It might also be a good idea to understand how AutoFixture integrates with

The following screencasts are available:

  1. Exercise 1
  2. Exercise 2
  3. Exercise 3
  4. Exercise 4
  5. Exercise 5
  6. Exercise 6
  7. Exercise 7
  8. Exercise 8

As a general note, I didn't focus much on refactoring in this exercise, as I didn't feel the complexity of the solution required it.

If you like these screencasts, you may also like my Pluralsight course Outside-In Test-Driven Development.


Thank you for these screencasts and for taking the friction out of Unit Testing! I have one question: how can you run all tests so quickly? I also use TestDriven.Net and have a keyboard shortcut attached to Run Tests. However, this command is contextual and only runs the current method / methods of the current class. I'm not aware of a Run all tests command (or something similar). I see you running all tests in the project even when you're outside the test class.
2013-07-31 14:43 UTC
Hi Cristian, thank you for writing. The way I use TestDriven.Net is that I have a keyboard shortcut (Shift+Alt+q, simply because that combination was available, and adequately fits my hand) assigned to TestDriven.NET.RunAllTestsInSolution, which Jamie Cansdale courteously added upon my request; I don't exactly remember at which version that command was added, but I'm currently running TestDriven.Net 3.4 Professional build 2808.
2013-07-31 18:26 UTC
Just installed the latest TestDriven.Net and I also have the RunAllTestsInSolution option now. Thanks! This is very handy.
2013-07-31 19:54 UTC

Wish to comment?

You can add a comment to this post by sending me a pull request. Alternatively, you can discuss this post on Twitter or Google Plus, or somewhere else with a permalink. Ping me with the link, and I may add it as a comment.


Wednesday, 06 February 2013 14:04:43 UTC


"Our team wholeheartedly endorses Mark. His expert service provides tremendous value."
Hire me!