public void A_subset_of_events_can_be_retrieved_by_querying_on_version_numbers() { NewConnection(con => { var eventStore = new GetEventStore(con); var streamName = CreateDisposableStreamName(); eventStore.AppendEventsToStream(streamName, testEvents, null); var fromEs = eventStore.GetStream(streamName, 1, 1); Assert.AreEqual(1, fromEs.Count()); Assert.AreEqual("Trevor", ((TestEvent)fromEs.Single()).Handle); }); }
public void Events_are_persisted_and_can_be_retrieved() { NewConnection(con => { var eventStore = new GetEventStore(con); var streamName = CreateDisposableStreamName(); eventStore.AppendEventsToStream(streamName, testEvents, null); var fromEs = eventStore.GetStream(streamName, 0, Int32.MaxValue - 1); Assert.AreEqual(fromEs.Count(), testEvents.Count()); foreach (var e in testEvents) { Assert.IsTrue(fromEs.Contains(e)); } }); }