Created
October 21, 2013 19:18
-
-
Save plioi/7089345 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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