public void verify_snapshot_check_version() { var id = new TestEventUnfolderId(1); var unfolder = new TestProjector(); var memento = (EventUnfolderMemento)unfolder.GetSnapshot(); memento.Signature = "OTHER"; //change the version of the memento. Snapshot s = new Snapshot(id, 2, memento); _persister.Load("", 1, "").ReturnsForAnyArgs(s); sut.GetById <TestProjector, TestAggregateQueryModel>(id, 200); _eventStore.Received().OpenStream("BLAH", id, 0, 200); }
public void verify_basic_in_memory_projection() { var id = new TestEventUnfolderId(Interlocked.Increment(ref progressive)); using (var stream = _eventStore.OpenStream("BLAH", id.AsString(), 0, Int32.MaxValue)) { CommitOneValue(stream, 42); } var unfolder = sut.GetById <TestProjector, TestAggregateQueryModel>(id, Int32.MaxValue); var rm = unfolder.GetProjection(); Assert.That(rm.Sum, Is.EqualTo(42)); Assert.That(rm.ListOfInt, Is.EquivalentTo(new[] { 42 })); }
public async Task <UserQueryModel> QueryById(Guid id) { return(await QueryModelRepository.GetById <UserQueryModel>(id)); }