private void StartSaga(IGameMessage @event, Saga saga) { _repository.Add(saga); try { saga.Handle(@event); } finally { CleanUp(saga); } }
public override void Assert(IContainer container) { container.Configure(cfg => { cfg.For <TEVENT>().Use <TEVENT>(); cfg.For <TRESPONSE>().Use <TRESPONSE>(); }); _saga.Handle(container.GetInstance <TEVENT>()); var eventAggregator = container.GetInstance <IEventAggregator>() as MockEventAggregator; eventAggregator.AssertMessageWasSent <TRESPONSE>(); }