- Download latest version. To eliminate confusion, I bumped up the version number to 9, to indicate this is to PowerBuilder version 9. You should be able to upgrade/migrate this to any Powerbuilder version higher than 9.
- Create your demo app, add pbunitfunc.pbl and pbunit.pbl into your app’s lib list.
- Create a nvo, this is the object to be tested later.
- OK, let create our first PowerBuilder test case. You have 2 options to put all test cases, a) same target as the demo app; b) create a different target to hold all test cases. (This needs duplicate all app settings in your new application object, especially for pfc app) To make it easier to start, we use the same target, which means testing object and tested object are in same project.
Test case object needs to inherit from testcase object in pbunit.pbl.
- The code in test case looks like this:
- Save this testcase object as n_cst_math_service_tests. To make auto-test run, I set a rule: all test case object should end up with ‘tests’, unless I can find a way to detect the ancestor of PowerBuilder’s object.
- Launch your pbunit.exe. Load this new target.Click ‘Run’ button. You should see your green bar now. Note, the ‘Run All’ button is for auto-run usage, a xml test result file is generated afterwards. Then can be embedded into CouriseControl continues auto build server.