namespace ClassLibrary1
{
public class Class1 : IExecutionExtension
{
#region IExecutionExtension Members
// After each test is completed, this method is called.
// <param name="executionContext">The execution context the test is running under.</param>
// <param name="result">The actual result of the test.</param>
public void OnAfterTestCompleted(ExecutionContext executionContext, TestResult result)
{
// Your custom implementation here
}
// After the test list is completed.
// <param name="result">The entire RunResult object.</param>
public void OnAfterTestListCompleted(RunResult result)
{
// Your custom implementation here.
}
// Before a test list is about to start execution.
// <param name="list">The test list that is about to start.</param>
public void OnBeforeTestListStarted(TestList list)
{
// Your custom implementation here
}
// Before a test is about to start.
// <param name="executionContext">The execution context the test is running under.</param>
// <param name="test">The test we are about to start running.</param>
public void OnBeforeTestStarted(ExecutionContext executionContext, ArtOfTest.WebAii.Design.ProjectModel.Test test)
{
// Your custom implementation here
}
// Use this to return your own data source.
// <param name="executionContext">The execution context.</param>
public System.Data.DataTable OnInitializeDataSource(ExecutionContext executionContext)
{
// Your custom implementation here
return null;
}
// Called only on a step failure.
// <param name="executionContext">The execution context a test is running under.</param>
// <param name="stepResult">The step result that just failed.</param>
public void OnStepFailure(ExecutionContext executionContext, ArtOfTest.WebAii.Design.AutomationStepResult stepResult)
{
// Your custom implementation here
}
#endregion
}
}
public void OnAfterTestListCompleted(RunResult result)
{
string msg = string.Format("TestList '{0}' completed on '{1}'. ({2}/{3}) Passed", result.Name, result.EndTime, result.PassedCount, result.TestResults.Count);
StreamWriter file = new StreamWriter("c:\\test-list-results.txt");
file.WriteLine(msg);
file.Close();
}