Writing clean, effective, and manageable tests begins with the “fixture”, the set of data used in the test. If you’ve ever struggled with the “arrange” part of a test, or if you’ve ever looked at someone else’s “arrange” and struggled to understand the context it establishes, then you’ve suffered the pains of poor fixture setup. In this session you’ll see a collection of patterns and techniques that will help you write smaller, more expressive tests that are easier to read, understand and maintain. We’ll talk about patterns for constructing test data for unit tests, patterns for saving that data in the database for integration tests, and some common anti-patterns that you may not realize you’re following. Code samples will be in C# and NUnit but the core concepts will be presented in a language-agnostic way and are applicable in many contexts. “Clean setup begets clean tests”. Let me show you how.
By |2017-01-14T09:10:59-05:00January 14th, 2017|