IONA Mock Object

A unit test should test in isolation the class under test. Mock objects are a commonly used technique to substitute any associates of the class under test with impostors who implement all the desired interfaces that the class under test is expecting. In addition, the impostors also implement a query interface so that tests can be written to determine whether the impostor has been called, and if so, with what arguments. By using this tool the unit test can then become more independent of any collaborations the class under test may have with other classes. Mock objects are also particularly useful for determining whether the class under test handles exceptional conditions correctly. A mock object can be programmed to fail in a deterministic fashion, e.g., to repeatedly throw an exception to test the failure handling of the class under test.

IN DEVELOPER CENTER...

Related Content

Need More Info?

Feel free to reach us by phone or email anytime of the day.

Contact Sales

For pricing and license information please contact a sales representative in your region:
AMER, EMEA or APAC