Exemplo n.º 1
0
        public async Task Should_rebuild_state()
        {
            SetupCreated(4);

            await sut.RebuildStateAsync();

            A.CallTo(() => persistence.WriteSnapshotAsync(A <MyDomainState> .That.Matches(x => x.Value == 4)))
            .MustHaveHappened();
            A.CallTo(() => persistence.WriteEventsAsync(A <IReadOnlyList <Envelope <IEvent> > > ._))
            .MustNotHaveHappened();
        }
Exemplo n.º 2
0
        public async Task Should_rebuild_state_async()
        {
            await SetupCreatedAsync();

            await sut.RebuildStateAsync();

            A.CallTo(() => persistence.WriteSnapshotAsync(A <MyDomainState> .That.Matches(x => x.Value == 4)))
            .MustHaveHappened();
            A.CallTo(() => persistence.WriteEventsAsync(A <IEnumerable <Envelope <IEvent> > > .Ignored))
            .MustHaveHappenedOnceExactly();
        }