O'Reilly logo

Test Driven Development: By Example by Kent Beck

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 23. How Suite It Is

Invoke test methodInvoke setUp firstInvoke tearDown afterwardInvoke tearDown even if the test method failsRun multiple testsReport collected resultsLog string in WasRunReport failed testsCatch and report setUp errors

We can't leave xUnit without visiting TestSuite. The end of our file, where we invoke all of the tests, is looking pretty ratty:

					print TestCaseTest("testTemplateMethod").run().summary()
					print TestCaseTest("testResult").run().summary()
					print TestCaseTest("testFailedResultFormatting").run().summary()
					print TestCaseTest("testFailedResult").run().summary()
				

Duplication is always a bad thing, unless you look at it as motivation to find the missing design element. Here we would like the ability ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required