protected override void Context()
        {
            _snapshot  = new Snapshot(streamId, HeadStreamRevision, "snapshot");
            _committed = new EnumerableCounter <ICommit>(
                new[] { BuildCommitStub(HeadStreamRevision, HeadCommitSequence) });

            Persistence.Setup(x => x.GetFrom(Bucket.Default, streamId, HeadStreamRevision, int.MaxValue)).Returns(_committed);
        }
        protected override Task Context()
        {
            _snapshot  = new Snapshot(streamId, HeadStreamRevision, "snapshot");
            _committed = new EnumerableCounter <ICommit>(
                new[] { BuildCommitStub(HeadStreamRevision, HeadCommitSequence) });

            A.CallTo(() => Persistence.GetFromAsync(Bucket.Default, streamId, HeadStreamRevision, int.MaxValue, A <CancellationToken> ._))
            .Returns(_committed);
            return(Task.CompletedTask);
        }
Esempio n. 3
0
        protected override Task Context()
        {
            _snapshot  = new Snapshot(streamId, HeadStreamRevision, "snapshot");
            _committed = new EnumerableCounter <ICommit>(
                new[] { BuildCommitStub(HeadStreamRevision, HeadCommitSequence) });

            Persistence
            .GetFrom(Bucket.Default, streamId, HeadStreamRevision, int.MaxValue)
            .Returns(_committed.ToAsync());
            //A.CallTo(() =>  Persistence.GetFrom(Bucket.Default, streamId, HeadStreamRevision, int.MaxValue))
            //    .Returns(_committed.ToAsync());
            return(Task.FromResult(true));
        }