Prev | Current Page 332 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

This could be opening a needed database
connection, reading a configuration file, and so on.
tearDown() : Void This is complementary to the setup() function
and is invoked after the test execution. Its main
purpose is to cleanup what the test has left (deleting
test records or files, and so on). The cleanup
phase is critical to maintain a testing environment
consistent each time the automation is repeated.
Table continued on following page
172
Part I: The Core Language
TestCase Method Description
assertTrue(b:Bool, ?c:PosInfos) :
Void
This is the core method for testing. Inside a test
function, assumptions are made using the assert
methods. If one of the assertions in the test is
wrong, the test fails; otherwise the test passes. The
b parameter must be true for the assertion being
valid.
assertFalse(b:Bool, ?c:PosInfos) :
Void
It ??™ s the opposite of the assertTrue function; the
assertion is successful when b is false.
assertEquals < T > (expected:T ,
actual:T, ?c:PosInfos) : Void
This compares the expected value with the actual
value and passes if the two are equal; otherwise it
fails.


Pages:
320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344