Think: “What am I testing?”

1) Set-up

Instantiate your class

Look for dependencies, are there any that need mocking?

2) Exercise

We test our real objects that need testing,

or mock objects that don’t but are required by SUT (System Under Test)

3) Verify

Real object results

Expectations of mocked objects

4) Tear down

Destroy objects if needed?

 

The four-phased testing technique explained here: http://xunitpatterns.com/Four%20Phase%20Test.html

 

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.