I code therefore I am.

June 22, 2009 at 1:41pm
0 notes
Comments (View)
home

Tags:
Test-Driven Development  

3 A’s Pattern For Writing Test Methods

Arrange, Act, Assert. Specifically, use separate code paragraphs (groups of lines of code separated by a blank line) for each of the As. Arrange is variable declaration and initialization. Act is invoking the code under test. Assert is using the Assert.* methods to verify that expectations were met. Following this pattern consistently makes it easy to revisit test code.

[source: Principles for Test-Driven Development]

blog comments powered by Disqus