Пример #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);
        }
Пример #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);
        }
Пример #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);
        }
Пример #4
0
 private bool Execute(TestFailedExecutionResultCommand command)
 {
     Sender.Tell(ExecutionResult.Failed(), Self);
     return(true);
 }
Пример #5
0
 public Task <Result> Do(TestFailedExecutionResultCommand command)
 {
     return(Task.FromResult(Result.Fail("ERROR")));
 }
Пример #6
0
 public Task <IExecutionResult> Execute(TestFailedExecutionResultCommand command)
 {
     Sender.Tell(ExecutionResult.Failed(), Self);
     return(Task.FromResult(ExecutionResult.Success()));
 }