public void ShouldWriteSummary() { var example = new ExampleResult { Reason = Resources.TestReason, ElapsedTime = 1000, Message = "Test Exception", StackTrace = "System.InvalidOperationException: Test Exception", Status = ResultStatus.Error }; var results = new Collection<ExpressionResult>(); var expression = new ExpressionResult(); var group = new ExampleGroupResult(); group.Examples.Add(example); expression.Examples.Add(group); results.Add(expression); this.consoleFormatter.WriteError(example); this.consoleFormatter.WriteSummary(results); this.stringWriter.Flush(); var value = "F" + Environment.NewLine + Environment.NewLine + "Failures:" + Environment.NewLine + Environment.NewLine + "1) test" + Environment.NewLine + " Failure/Error: System.InvalidOperationException: Test Exception" + Environment.NewLine + Environment.NewLine + "Finished in 1 seconds" + Environment.NewLine + "1 examples, 1 failures" + Environment.NewLine; this.stringWriter.ToString().Should().Be(value); }
public ExampleResult CreateExampleResult() { var obj = new ExampleResult(); this.ExampleResults.Add(obj); return(obj); }
public override void WriteError(ExampleResult example) { var message = string.Format(CultureInfo.CurrentCulture, Resources.DocumentationConsoleFormatterErrorMessage, example.Reason); writter.WriteErrorLine(string.Concat(StringHelper.DoubleSpace, message)); }
public void ShouldWriteSummary() { var example = new ExampleResult { Reason = Resources.TestReason, ElapsedTime = 1000, Message = "Test Exception", StackTrace = "System.InvalidOperationException: Test Exception", Status = ResultStatus.Error }; var results = new Collection <ExpressionResult>(); var expression = new ExpressionResult(); var group = new ExampleGroupResult(); group.Examples.Add(example); expression.Examples.Add(group); results.Add(expression); this.consoleFormatter.WriteError(example); this.consoleFormatter.WriteSummary(results); this.stringWriter.Flush(); var value = "F" + Environment.NewLine + Environment.NewLine + "Failures:" + Environment.NewLine + Environment.NewLine + "1) test" + Environment.NewLine + " Failure/Error: System.InvalidOperationException: Test Exception" + Environment.NewLine + Environment.NewLine + "Finished in 1 seconds" + Environment.NewLine + "1 examples, 1 failures" + Environment.NewLine; this.stringWriter.ToString().Should().Be(value); }
public override void WriteError(ExampleResult example) { var message = string.Format(CultureInfo.CurrentCulture, Resources.DocumentationConsoleFormatterErrorMessage, example.Reason); writter.WriteErrorLine(string.Concat(StringHelper.DoubleSpace, message)); }
public void ShouldWriteSuccess() { var result = new ExampleResult { Reason = Resources.TestReason, Status = ResultStatus.Success }; consoleFormatter.WriteSuccess(result); stringWriter.Flush(); var value = Environment.NewLine + Resources.TestReason + Environment.NewLine + StringHelper.DoubleSpace + Resources.TestReason + Environment.NewLine; stringWriter.ToString().Should().Be(value); }
public void ShouldWriteSuccess() { var result = new ExampleResult { Reason = Resources.TestReason, Status = ResultStatus.Success }; consoleFormatter.WriteSuccess(result); stringWriter.Flush(); var value = Environment.NewLine + Resources.TestReason + Environment.NewLine + StringHelper.DoubleSpace + Resources.TestReason + Environment.NewLine; stringWriter.ToString().Should().Be(value); }
public void UpdateData(IResult result, ExampleOperationModel exampleOperationModel, ExampleOperationModel exampleOperationModelClone) { _exampleResult = (ExampleResult)result; _exampleOperationModelClone = exampleOperationModelClone; _exampleOperationModel = exampleOperationModel; if (_exampleResult != null) { _isResultEmpty = false; } else { _isResultEmpty = true; } }
public void ShouldWriteSummaryWithOneSuccess() { var results = new Collection <ExpressionResult>(); var result = new ExpressionResult(); var group = new ExampleGroupResult(); var example = new ExampleResult { ElapsedTime = 1000 }; group.Examples.Add(example); result.Examples.Add(group); results.Add(result); consoleFormatter.WriteSummary(results); stringWriter.Flush(); var value = Environment.NewLine + Resources.TestReason + Environment.NewLine + Environment.NewLine + "Finished in 1 seconds" + Environment.NewLine + "1 examples, 0 failures" + Environment.NewLine; stringWriter.ToString().Should().Be(value); }
public abstract void WriteError(ExampleResult example);
public override void WriteSuccess(ExampleResult example) { writter.WriteSuccessLine(string.Concat(StringHelper.DoubleSpace, example.Reason)); }
public override void WriteSuccess(ExampleResult example) { writter.WriteSuccessLine(string.Concat(StringHelper.DoubleSpace, example.Reason)); }
public override void WriteSuccess(ExampleResult example) { writter.WriteSuccess(Resources.ConsoleFormatterSuccessMessage); }
public override void WriteError(ExampleResult example) { writter.WriteError(Resources.ConsoleFormatterErrorMessage); }
public override void WriteSuccess(ExampleResult example) { writter.WriteSuccess(Resources.ConsoleFormatterSuccessMessage); }
public override void WriteError(ExampleResult example) { writter.WriteError(Resources.ConsoleFormatterErrorMessage); }
public void ShouldWriteSummaryWithOneSuccess() { var results = new Collection<ExpressionResult>(); var result = new ExpressionResult(); var group = new ExampleGroupResult(); var example = new ExampleResult { ElapsedTime = 1000 }; group.Examples.Add(example); result.Examples.Add(group); results.Add(result); consoleFormatter.WriteSummary(results); stringWriter.Flush(); var value = Environment.NewLine + Resources.TestReason + Environment.NewLine + Environment.NewLine + "Finished in 1 seconds" + Environment.NewLine + "1 examples, 0 failures" + Environment.NewLine; stringWriter.ToString().Should().Be(value); }
public abstract void WriteSuccess(ExampleResult example);
public override void WriteError(ExampleResult example) { }
public override void WriteSuccess(ExampleResult example) { }
public abstract void WriteError(ExampleResult example);
public abstract void WriteSuccess(ExampleResult example);