public void STORE_NEW_EVENTS_ON_NEW_DOCUMENT() { MongoEventStore store = new MongoEventStore(client); Events.SampleEvent _event = new Events.SampleEvent{Message = "Test",id = id}; IList<IEvent> events = new List<IEvent>(); events.Add(_event); store.AppendToStream(id, 1, events); }
public void INSERT_HUNDRED_EVENTS() { MongoEventStore store = new MongoEventStore(client); client.GetServer().GetDatabase("EventStore").Drop(); Enumerable. Range(1, 100). ToList(). ForEach(i => { var newid = new Events.SampleID(i); Events.SampleEvent _event = new Events.SampleEvent { Message = "Test", id = newid }; IList<IEvent> events = new List<IEvent>(); events.Add(_event); store.AppendToStream(newid, 1, events); }); }
public void RETREIVE_EVENT_STREAM_FOR_AN_EXISTING_DOCUMENT() { MongoEventStore store = new MongoEventStore(client); var events = store.LoadEventStream(id); Assert.IsFalse(events == null); }
public void RETREIVE_ALL_EVENTS() { MongoEventStore store = new MongoEventStore(client); var events = store.LoadEvents(0, int.MaxValue); Assert.IsFalse(events.Count == 0); }