Creating test cases for event strategies
Validate whether event strategies perform as designed through unit testing. By unit testing the event strategy configuration during development or every time you make a change, you can increase the reliability of your configuration and decrease the cost of fixing design flaws due to early detection.
- Ensure that the current ruleset is enabled to store test cases. For more information, see Creating a test ruleset to store test cases.
- Perform a test run of the event strategy configuration and review the results. The results will be the benchmark for further testing. For more information, see Unit testing event strategies.
In the Run window of the event strategy, click Convert to test.
To provide additional details, such as test objectives, fill in the Description field.
In the Expected results section, add an assertion type. Choose one of the following assertion types:
- To ensure that the value of a specific event property, a group of
properties, or aggregates in the pxResults class meet
your expectations, select Property and then click
For more information, see Configuring property assertions
- To determine whether the expected result is in event strategy output,
For more information, see Configuring list assertions
- To ensure that event strategy run time does not exceed a specific value
(in seconds), select Expected run time.
For more information, see Configuring expected run-time assertions
- To assert on the number of emitted events, select Result
count. For example, you can determine that the event
strategy passes the unit test when only one event is emitted for three
dropped calls within a day.
For more information, see Configuring result count assertions
- To ensure that the value of a specific event property, a group of properties, or aggregates in the pxResults class meet your expectations, select Property and then click + Properties.
If you want to check more then one assertion, repeat step 3.
To configure the test environment and determine any additional steps to perform before or after running the test case, click the Setup & Cleanup tab.