Skip to content

Instantly share code, notes, and snippets.

@plioi
Created October 21, 2013 19:18
Show Gist options
  • Save plioi/7089345 to your computer and use it in GitHub Desktop.
Save plioi/7089345 to your computer and use it in GitHub Desktop.
public class ExecuteCases : InstanceBehavior
{
public void Execute(Fixture fixture)
{
foreach (var @case in fixture.Cases)
{
using (var console = new RedirectedConsole())
{
var stopwatch = new Stopwatch();
stopwatch.Start();
try
{
fixture.CaseExecutionBehavior.Execute(@case, fixture.Instance);
}
catch (Exception exception)
{
@case.Fail(exception);
}
stopwatch.Stop();
@case.Duration = stopwatch.Elapsed;
@case.Output = console.Output;
}
Console.Write(@case.Output);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment