The given-expect testing pattern

added by rholm
4/28/2010 11:15:54 AM

0 Kicks, 84 Views

I was watching Brett Schuchert’s TDD screencast on implementing the shunting yard algorithm in C#. In it Brett builds up his tests in a style I hadn’t come across before. Each test is expressed as a given-expect statement. A pattern particularly useful in situations in which a class has a main method that accepts an open-ended number of dissimilar inputs.