public async Task Then_execute_throws_exception_from_aggregate_with_stack_trace() { var syncCommand = new AlwaysFaultAsyncCommand(Guid.NewGuid()); var expectedMessage = Expect.Message <SampleAggregateChangedEvent>(e => e.SourceId, syncCommand.AggregateId); await GridNode.Execute(CommandPlan.New(syncCommand, Timeout, expectedMessage)) .ShouldThrow <SampleAggregateException>(e => e.StackTrace.Contains(typeof(SampleAggregate).Name)); }
public async Task When_execute_aggregate_command_with_fault_and_metadata() { _command = new AlwaysFaultAsyncCommand(Guid.NewGuid(), TimeSpan.FromMilliseconds(50)); _commandMetadata = new MessageMetadata(_command.Id, BusinessDateTime.Now, Guid.NewGuid()); var res = await GridNode.NewCommandWaiter(null, false) .Expect <SampleAggregateCreatedEvent>() .Create() .Execute(_command, _commandMetadata); _answer = res.Message <IMessageMetadataEnvelop <IFault <AlwaysFaultAsyncCommand> > >(); }