Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
 private bool Execute(TestFailedExecutionResultCommand command)
 {
     Sender.Tell(ExecutionResult.Failed(), Self);
     return(true);
 }
Exemplo n.º 5
0
 public Task <Result> Do(TestFailedExecutionResultCommand command)
 {
     return(Task.FromResult(Result.Fail("ERROR")));
 }
Exemplo n.º 6
0
 public Task <IExecutionResult> Execute(TestFailedExecutionResultCommand command)
 {
     Sender.Tell(ExecutionResult.Failed(), Self);
     return(Task.FromResult(ExecutionResult.Success()));
 }