public void Given_command_executes_with_waiter_When_fetching_results()
        {
            _syncCommandA = new LongOperationCommand(100, Guid.NewGuid());
            _syncCommandB = new LongOperationCommand(200, Guid.NewGuid());
            _syncCommandC = new LongOperationCommand(150, Guid.NewGuid());


            _results = GridNode.NewCommandWaiter(Timeout)
                       .Expect <AggregateChangedEventNotification>(e => e.AggregateId == _syncCommandA.AggregateId)
                       .And <AggregateChangedEventNotification>(e => e.AggregateId == _syncCommandB.AggregateId)
                       .And <AggregateChangedEventNotification>(e => e.AggregateId == _syncCommandC.AggregateId)
                       .Create()
                       .Execute(_syncCommandA, _syncCommandB, _syncCommandC)
                       .Result;

            _changedEventA = _results.Message <AggregateChangedEventNotification>(e => e.AggregateId == _syncCommandA.AggregateId);
            _changedEventB = _results.Message <AggregateChangedEventNotification>(e => e.AggregateId == _syncCommandB.AggregateId);
            _changedEventC = _results.Message <AggregateChangedEventNotification>(e => e.AggregateId == _syncCommandC.AggregateId);

            _aggregateA = LoadAggregate <SampleAggregate>(_syncCommandA.AggregateId);
        }
Esempio n. 2
0
 public void Then_recieved_collection_of_expected_messages()
 {
     Assert.IsTrue(_results.Message <SampleAggregateChangedEvent>() != null &&
                   _results.Message <SampleAggregateCreatedEvent>() != null);
 }