Tuesday, August 2, 2011

Unit Testing K2 Processes

Discusses how to build automated unit tests in Visual Studio that test K2 processes. The document also includes best practices such as testing scenarios versus testing methods, testing line rules, testing task assignments, using the K2 reporting SmartObjects to test activity execution, using XML files to test InfoPath forms, substituting K2 SmartBox SmartObjects for SmartObjects that connect to external systems to mock the external systems during testing, and giving process rights to the build process.
In addition to the best practices the document also includes examples on how to perform common development tasks such as starting a process, getting a worklist, submitting an action for a worklist item, ensuring an activity is executed, and a list of scenarios for testing a sample K2 process.
Also, see the accompanying source code file that includes the sample K2 process, a framework project for performing many of the common development tasks, and a unit test project that tests the sample K2 process.
The files can be found on the K2 Underground here.
Thanks,
Roy Higgs