public void set_result_command_test() { var command = new SetResultCommand { AggregateRootId = ObjectId.GenerateNewStringId(), Result = "CommandResult" }; var commandResult = _commandService.ExecuteAsync(command, CommandReturnType.EventHandled).Result; Assert.IsNotNull(commandResult); Assert.AreEqual(CommandStatus.Success, commandResult.Status); Assert.AreEqual("CommandResult", commandResult.Result); }
public void set_result_command_test() { var command = new SetResultCommand { AggregateRootId = ObjectId.GenerateNewStringId(), Result = "CommandResult" }; var asyncResult = _commandService.ExecuteAsync(command, CommandReturnType.EventHandled).Result; Assert.IsNotNull(asyncResult); Assert.AreEqual(AsyncTaskStatus.Success, asyncResult.Status); var commandResult = asyncResult.Data; Assert.IsNotNull(commandResult); Assert.AreEqual(CommandStatus.Success, commandResult.Status); Assert.AreEqual("CommandResult", commandResult.Result); }
public Task HandleAsync(ICommandContext context, SetResultCommand command) { context.Add(new TestAggregate(command.AggregateRootId, "")); context.SetResult(command.Result); return(Task.CompletedTask); }
public void Handle(ICommandContext context, SetResultCommand command) { context.Add(new TestAggregate(command.AggregateRootId, "")); context.SetResult(command.Result); }