public void BeforeEach() { originalWritter = Console.Out; stringWriter = new StringWriter(CultureInfo.CurrentCulture); Console.SetOut(stringWriter); consoleFormatter = new DocumentionConsoleFormatter(new DefaultConsoleWritter()); consoleFormatter.WriteInformation(Resources.TestReason); }
protected ExpressionResult ExecuteSpecification(Specification specification, string exampleText) { var result = runner.Execute(specification.BuildExpression(), exampleText); foreach (var exampleGroup in result.Examples) { formatter.WriteInformation(exampleGroup.Reason); foreach (var example in exampleGroup.Examples) { if (example.Status == ResultStatus.Success) { formatter.WriteSuccess(example); } else { formatter.WriteError(example); } } } return(result); }