Example #1
0
        public void FailingCommand_execute_should_fail()
        {
            var sut = new FailingCommand();

            var result = sut.Execute();

            result.Outcome.Should().Be(CommandOutcomeType.Failure);
        }
        public void should_catch_exceptions()
        {
            _messageDispatcher.LoadMessageHandlerInvokers();

            var command = new FailingCommand(new InvalidOperationException(":'("));
            var result  = DispatchAndWaitForCompletion(command);

            var error = result.Errors.ExpectedSingle();

            error.ShouldEqual(command.Exception);
        }
        public void should_catch_exceptions()
        {
            _messageDispatcher.LoadMessageHandlerInvokers();

            var command = new FailingCommand(new InvalidOperationException(":'("));

            Dispatch(command);

            var error = _dispatchResultRef.Value.Errors.ExpectedSingle();

            error.ShouldEqual(command.Exception);
        }
 public void HandleCommand(FailingCommand c)
 {
     Environment.ExitCode = 100;
 }