public void async_command_handler_test() { var command = new AsyncHandlerCommand() { 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.Success, commandResult.Status); }
public void duplicate_async_command_with_application_message_test() { var command = new AsyncHandlerCommand() { AggregateRootId = ObjectId.GenerateNewStringId(), ShouldGenerateApplicationMessage = true }; 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.Success, commandResult.Status); asyncResult = _commandService.ExecuteAsync(command).Result; Assert.IsNotNull(asyncResult); Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status); commandResult = asyncResult.Data; Assert.IsNotNull(commandResult); Assert.AreEqual(CommandStatus.Success, commandResult.Status); }