示例#1
0
        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");
        }
示例#2
0
        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");
        }
示例#3
0
        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");
        }