public async Task InitialState_TestingFailedCommand_SuccessResultReplied() { var aggregateManager = Sys.ActorOf(Props.Create(() => new TestAggregateManager()), "test-aggregatemanager"); var aggregateId = TestAggregateId.New; var commandId = CommandId.New; var command = new TestFailedExecutionResultCommand(aggregateId, commandId); var result = await aggregateManager.Ask <FailedExecutionResult>(command); }
public async Task InitialState_TestingFailedCommand_SuccessResultReplied() { var aggregateId = TestAggregateId.New; var commandId = CommandId.New; var command = new TestFailedExecutionResultCommand(aggregateId, commandId); var bus = Sys.GetExtension <ServiceProviderHolder>().ServiceProvider.GetRequiredService <ICommandBus>(); await bus.Publish(command); }
public void InitialState_TestingFailedCommand_SuccessResultReplied() { var aggregateId = TestAggregateId.New; var commandId = SourceId.New; var command = new TestFailedExecutionResultCommand(aggregateId).WithSourceId(commandId); var fixture = new AggregateFixture <TestAggregateId, TestAggregate, ITestAggregateState, TestAggregateState>(this); fixture.For(aggregateId) .GivenNothing() .When(command) .ThenExpectResult(r => !r.IsSuccess); }
private bool Execute(TestFailedExecutionResultCommand command) { Sender.Tell(ExecutionResult.Failed(), Self); return(true); }
public Task <Result> Do(TestFailedExecutionResultCommand command) { return(Task.FromResult(Result.Fail("ERROR"))); }
public Task <IExecutionResult> Execute(TestFailedExecutionResultCommand command) { Sender.Tell(ExecutionResult.Failed(), Self); return(Task.FromResult(ExecutionResult.Success())); }