FunctionSkipped Event
Occurs when a TestFunction is skipped due to its Condition evaluating to false.
Type: Runner
Namespace: XJTAG.Integration.XJRunner
Syntax
public event EventHandler<FunctionSkippedEventArgs> FunctionSkipped
Remarks
This event is fired from the thread on which the test code is running. You therefore need to be careful about synchronising access to your data structures and, if your code accesses any user interface controls, you will need to use BeginInvoke to ensure that you access methods and properties from the appropriate thread.
Example
In this case we subscribe to the FunctionSkipped event of a Runner object and give an example of how the FunctionSkippedEventArgs object is used to extract information from the event.
class Testing { Runner runner; TestCollection testList; TestFunction skippedFunction; string skippedFunctionName; string skippedFunctionTestGroupName; void InitialiseRunner() { /* * ... * Code to obtain Runner object from project and get test list. * ... */ // Subscribe to FunctionSkipped event. runner.FunctionSkipped += runner_FunctionSkipped; // Run tests. runner.RunTests(testList); } void runner_FunctionSkipped(object sender, FunctionSkippedEventArgs e) { // We use the FunctionSkippedEventArgs to retrieve information on the function that has // been skipped. // Get the TestFunction which was skipped. skippedFunction = e.Function; // Get the name of the TestFunction that was skipped and the TestGroup it belongs to. skippedFunctionTestGroupName = e.Function.TestGroup.Name; skippedFunctionName = e.Function.Name; } }
See Also
XJTAG v4.2.5
