-
Book Overview & Buying
-
Table Of Contents
Agile Technical Practices Distilled
By :
So, you have written your first test, and it is failing for the right reason. Now what? How do you make it pass (make it green)? There are a few simple ways to achieve this.
Just return the exact value you need. If your test expects a zero from a method, simply do it. Usually, you use this when you are unsure about how to implement a specific functionality, or your previous steps were too significant, and you cannot figure out what went wrong. Something that works is better than something that doesn't work!
When you are sure of the code you need to write, write it, and see the test go green! Most of the time, you will use this method to move forward with TDD quickly.
When you want to introduce new behavior, write a new and more specific test that forces the code to be more generic (triangulation equals using tests as pivot points...
Change the font size
Change margin width
Change background colour