Skip to content

References

SATO Kentaro edited this page Mar 11, 2012 · 1 revision

Test Class Methods

Initializing test class

SetUpBeforeClass() {
	...your setup process...
}

Static method SetUpBeforeClass() is called before starting tests.

Cleaning up test class

TearDownAfterClass() {
	...your cleanup process...
}

Static method TearDownAfterClass() is called after all test cases.

Initializing test class instance

SetUp() {
	...your setup process...
}

Method SetUp() is called before each test case on new instances.

Cleaning up test class instance

TearDown() {
	...your cleanup process...
}

Method TearDown() is called after each test case.

Assertions

TODO

AhkUnit_Framework methods
AssertEqual(expected, actual, message = "")
AssertNotEqual(expected, actual, message = "")
AssertEqualIgnoreCase(expected, actual, message = "")
AssertNotEqualIgnoreCase(expected, actual, message = "")
AssertObjectEqual(expected, actual, message = "")
AssertTrue(actual, message = "")
AssertFalse(actual, message = "")
AssertEmpty(actual, message = "")
AssertNotEmpty(actual, message = "")
AssertObject(actual, message = "")

Testing exceptions

Define an static member variable "YourTestName_throws" as "ExceptionName."

static ExceptionTest_throws := "ThrowingException"
ExceptionTest() {
	throw new ThrowingException()
}

static ExceptionTest_throws := "Exception"
ExceptionTest() {
	throw 3
}

Clone this wiki locally