public void Accept_should_generate_DocumentAcceptedEvent() { Document3 d = new Document3(12); d.Accept(); var events = (d as IHaveEvents).GetEvents(); Assert.IsTrue(events.Count() == 2); Assert.IsTrue(events.First().GetType() == typeof(DocumentCreated)); Assert.IsTrue(events.ToList()[1].GetType() == typeof(DocumentAccepted)); }
public void Service_full_test() { using (ISession session = _sessionFactory.OpenSession()) { _documentRepository = new GenericEventRepository <Document3>(session, new EventSerializer()); Document3 document3 = _documentFoctory.Create(12); document3.Accept(); _documentRepository.Save(document3); Document3 doc = _documentRepository.Load(document3.Id); Assert.IsNotNull(doc); } }