public void GivenAnErrorResult_ReportError() { var result = new TaskResult (); result.Error ("my error"); var receiver = new TestTaskResultReceiver (); result.SendSubResultsTo (receiver); receiver.AssertResultCount (1); receiver.AssertMessageAndTypeEquals (1, "Error", "my error"); }
public void GivenMultipleErrorResults_ReportAllErrors() { var result = new TaskResult (); result.Error ("my error"); result.Error ("my error2"); var receiver = new TestTaskResultReceiver (); result.SendSubResultsTo (receiver); receiver.AssertResultCount (2); receiver.AssertMessageAndTypeEquals (1, "Error", "my error"); receiver.AssertMessageAndTypeEquals (2, "Error", "my error2"); }
public void GivenAnErrorAndSuccess_ReportBoth() { var result = new TaskResult (); result.Success ("my success"); result.Error ("my error"); var receiver = new TestTaskResultReceiver (); result.SendSubResultsTo (receiver); receiver.AssertResultCount (2); receiver.AssertMessageAndTypeEquals (1, "Success", "my success"); receiver.AssertMessageAndTypeEquals (2, "Error", "my error"); }