public void handler_throw_exception_command_test() { var command = new ThrowExceptionCommand { AggregateRootId = ObjectId.GenerateNewStringId() }; var commandResult = _commandService.ExecuteAsync(command).Result; Assert.IsNotNull(commandResult); Assert.AreEqual(CommandStatus.Failed, commandResult.Status); }
public Task HandleAsync(ICommandContext context, ThrowExceptionCommand command) { throw new Exception("CommandException"); }
public void Handle(ThrowExceptionCommand command) { base.Handle(command); throw new TestCommandHandlerException("This is a triggered post-processing exception."); }
public Task HandleAsync(ThrowExceptionCommand command, CancellationToken cancellationToken = default(CancellationToken)) { base.HandleAsync(command); return(Task.FromException(new TestCommandHandlerException("This is a triggered post-processing exception."))); }
public void HandleThrowExceptionCommand(ThrowExceptionCommand command) { BaseHandle(command); throw new TestCommandHandlerException("This is a triggered exception."); }
public void handler_throw_exception_command_test() { var command = new ThrowExceptionCommand { AggregateRootId = ObjectId.GenerateNewStringId() }; var asyncResult = _commandService.ExecuteAsync(command).Result; Assert.IsNotNull(asyncResult); Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status); var commandResult = asyncResult.Data; Assert.IsNotNull(commandResult); Assert.AreEqual(CommandStatus.Failed, commandResult.Status); }
public void Handle(ICommandContext context, ThrowExceptionCommand command) { throw new Exception("CommandException"); }