public void get_max_sequence_if_no_corresponding_event() { var store = new SqlEventStore(new DomainEventJsonEventSerializer(), new FakeEventStamping()); var sequence = store.GetLastSequence(Guid.NewGuid()); sequence.Should().Be(0); }
public void get_max_sequence_if_events_exists() { var id = Guid.NewGuid(); var store = new SqlEventStore(new DomainEventJsonEventSerializer(), new FakeEventStamping()); store.Save(new SqlTestEvent(id, 1, "test")); store.Save(new SqlTestEvent(id, 2, "test2")); store.Save(new SqlTestEvent(id, 3, "test3")); var lastSequence = store.GetLastSequence(id); lastSequence.Should().Be(3); }