public async Task should_skip_holes() { var sequence = await CreateStream("sequence_1").ConfigureAwait(false); await _persistence.DeleteAsync(sequence.Id, 2, 9).ConfigureAwait(false); var result = await sequence .Fold() .ToIndex(10) .WithCache(_snapshots) .RunAsync <Sum>().ConfigureAwait(false); Assert.Equal(11, result.Total); }
public static Task DeleteAsync( this IPersistence persistence, string partitionId ) { return(persistence.DeleteAsync(partitionId, 0, long.MaxValue, CancellationToken.None)); }
public static Task DeleteAsync( this IPersistence persistence, string partitionId, long fromLowerIndexInclusive ) { return(persistence.DeleteAsync(partitionId, fromLowerIndexInclusive, long.MaxValue, CancellationToken.None)); }
public Task DeleteAsync(string partitionId, long fromLowerIndexInclusive, long toUpperIndexInclusive, CancellationToken cancellationToken) { return(Track.Profile(Timers.Delete, () => _persistence.DeleteAsync(partitionId, fromLowerIndexInclusive, toUpperIndexInclusive, cancellationToken) )); }
public Task Remove( string aggregateId, long fromVersionInclusive, long toVersionInclusive, CancellationToken cancellationToken) { return(_store.DeleteAsync(aggregateId, fromVersionInclusive, toVersionInclusive, cancellationToken)); }
public async Task Should_invoke_persistence_on_clear() { await sut.ActivateAsync(id); await sut.PublicClearAsync(); A.CallTo(() => persistence.DeleteAsync()) .MustHaveHappened(); }
public static Task DeleteAsync( this IPersistence store, string partitionId, long fromLowerIndexInclusive, long toUpperIndexInclusive ) { return(store.DeleteAsync(partitionId, fromLowerIndexInclusive, toUpperIndexInclusive, CancellationToken.None)); }
public async Task DeleteAsync( string partitionId, long fromLowerIndexInclusive, long toUpperIndexInclusive, CancellationToken cancellationToken) { await DeleteCounter.CaptureAsync(() => _store.DeleteAsync(partitionId, fromLowerIndexInclusive, toUpperIndexInclusive, cancellationToken) ).ConfigureAwait(false); }
public async Task DeleteAsync( string partitionId, long fromLowerIndexInclusive, long toUpperIndexInclusive, CancellationToken cancellationToken) { _logger.LogDebug("Start DeleteAsync({partitionId}, {from}, {to})", partitionId, fromLowerIndexInclusive, toUpperIndexInclusive); await _persistence.DeleteAsync(partitionId, fromLowerIndexInclusive, toUpperIndexInclusive, cancellationToken).ConfigureAwait(false); _logger.LogDebug("End DeleteAsync({partitionId}, {from}, {to})", partitionId, fromLowerIndexInclusive, toUpperIndexInclusive); }
public async Task delete_should_be_recorded() { await _store.DeleteAsync("empty").ConfigureAwait(false); Assert.Equal(0, _profile.PersistCounter.Calls); Assert.Equal(1, _profile.DeleteCounter.Calls); Assert.Equal(0, _profile.StoreScanCounter.Calls); Assert.Equal(0, _profile.ReadForwardCounter.Calls); Assert.Equal(0, _profile.ReadBackwardCounter.Calls); Assert.Equal(0, _profile.ReadSingleBackwardCounter.Calls); }
public async void delete_should_be_recorded() { await _store.DeleteAsync("empty"); Assert.Equal(0, _profile.PersistCounter.Calls); Assert.Equal(1, _profile.DeleteCounter.Calls); Assert.Equal(0, _profile.StoreScanCounter.Calls); Assert.Equal(0, _profile.ReadForwardCounter.Calls); Assert.Equal(0, _profile.ReadBackwardCounter.Calls); Assert.Equal(0, _profile.PeekCounter.Calls); }
public async Task Should_delete_and_reset_state_when_cleaning() { await sut.AddSchemaAsync(schemaId1, schemaName1); await sut.ClearAsync(); var id = await sut.GetSchemaIdAsync(schemaName1); Assert.Equal(id, Guid.Empty); A.CallTo(() => persistence.DeleteAsync()) .MustHaveHappened(); }
public async Task Should_delete_and_reset_state_when_cleaning() { await sut.AddRuleAsync(ruleId1); await sut.AddRuleAsync(ruleId2); await sut.ClearAsync(); var ids = await sut.GetRuleIdsAsync(); Assert.Empty(ids); A.CallTo(() => persistence.DeleteAsync()) .MustHaveHappened(); }
public async Task Should_delete_and_reset_state_when_cleaning() { await sut.NormalizeTagsAsync(HashSet.Of("name1", "name2"), null); await sut.NormalizeTagsAsync(HashSet.Of("name2", "name3"), null); await sut.ClearAsync(); var allTags = await sut.GetTagsAsync(); Assert.Empty(allTags); A.CallTo(() => persistence.DeleteAsync()) .MustHaveHappened(); }
public async Task Should_write_events_to_delete_stream_on_delete() { SetupCreated(4); SetupDeleted(); var deleteStream = A.Fake <IPersistence>(); A.CallTo(() => store.WithEventSourcing(typeof(MyDomainObject), DomainId.Combine(id, DomainId.Create("deleted")), null)) .Returns(deleteStream); await sut.ExecuteAsync(new DeletePermanent()); AssertSnapshot(sut.Snapshot, 0, EtagVersion.Empty, false); A.CallTo(() => persistence.DeleteAsync()) .MustHaveHappened(); A.CallTo(() => persistence.WriteEventsAsync(A <IReadOnlyList <Envelope <IEvent> > > ._)) .MustHaveHappenedOnceExactly(); A.CallTo(() => deleteStream.WriteEventsAsync(A <IReadOnlyList <Envelope <IEvent> > > ._)) .MustHaveHappened(); }
public Task ClearStateAsync() { State = new T(); return(persistence.DeleteAsync()); }
public Task ClearAsync() { Value = new T(); return(persistence.DeleteAsync()); }
public Task DeleteAsync(string partitionId, long fromLowerIndexInclusive, long toUpperIndexInclusive, CancellationToken cancellationToken) { return(_persistence.DeleteAsync(partitionId, fromLowerIndexInclusive, toUpperIndexInclusive, cancellationToken)); }
public Task DeleteAsync(string snapshotPartitionId, long fromVersionInclusive, long toVersionInclusive, CancellationToken cancellationToken) { return(_store.DeleteAsync(snapshotPartitionId, fromVersionInclusive, toVersionInclusive, cancellationToken)); }
public Task ClearAsync() { state = new State(); return(persistence.DeleteAsync()); }
public async Task DeleteEventsAsync(string actorName, long inclusiveToIndex) { await _events.DeleteAsync(actorName, 0, inclusiveToIndex).ConfigureAwait(false); }