public void Should_apply_sent_message_event() { var @event = _source.Flush().OfType <SentMessageEvent>().Single(); Assert.AreEqual(_userId, @event.UserId); Assert.AreEqual(_messageId, @event.MessageId); Assert.AreEqual(_message, @event.Message); Assert.IsTrue(@event.Sent > _now); }
public T Build() { _source = _aggregate = _eventSourceFactory.Create <T>(); _source.Hydrate(_events); _source.Flush(); return(_aggregate); }
protected override void Event() { _flushedEvents = _eventSource.Flush().Cast <IEvent>(); }