/TestNaming

Demonstration of a test naming style suggested by Kevlin Henney at NDC 2014.

Primary LanguageC#

Test Naming Kevlin Henney Style

This repository demonstrates the test naming suggested in the a talk at NDC 2014. A recorded version of the talk is available on http://vimeo.com/97329157 the part about test naming starts at 58:48.

On of the major points about test naming was also made be Kevlin Henney in the following tweet:

Test names should reflect outcome not aspiration: doesn't make sense to see "X should give Y" as a result; on passing, result is "X gives Y"

— Kevlin Henney (@KevlinHenney) June 27, 2013
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>

I wrote the example code in steps:

  1. Write out specification of the Categorizer as test cases
  2. Implement the test cases one by one - and refactor on green when appropriate.
  3. Done.