public void ShouldWriteError()
        {
            consoleFormatter.WriteError(new ExampleResult {
                Reason     = Resources.TestReason,
                Status     = ResultStatus.Error,
                StackTrace = new InvalidOperationException("Test Exception").ToString()
            });
            stringWriter.Flush();
            var value = Environment.NewLine + Resources.TestReason + Environment.NewLine +
                        StringHelper.DoubleSpace + Resources.TestReason + " (FAILED)" + Environment.NewLine;

            stringWriter.ToString().Should().Be(value);
        }
        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);
        }