Ability to listen for TestResult events
Badgerati opened this issue · 1 comments
When the tests are started via EdisonContext -> Run
, you have to wait till after the tests have all finished running or have a separate thread polling the EdisonContext
's ResultQueue
for chances.
It would be nicer if you could attach a listener to the EdisonContext
that would be called on TestResult events after each test, for external updating.
Any other kind of events would be useful also.
The EdisonContext
now has an OnTestResult
event handler. Attaching an event listener to this will cause ping backs when a test has finished running.
The event listener will have only the TestResult
object passed to it, i.e.:
public void Main()
{
var context = new EdisonContext();
context.OnTestResult += EdisonContext_OnTestResult;
}
private void EdisonContext_OnTestResult(TestResult result)
{
// do stuff here
}
An example can be seen within the Edison.GUI
Form logic where the handler is used for test counts, and populating the Fail Tests list box tab.