public async Task Remove_NotExistingSequence_NoExceptionThrown()
        {
            var store   = new DefaultSequenceStore(new IntegrationLoggerSubstitute <DefaultSequenceStore>());
            var context = ConsumerPipelineContextHelper.CreateSubstitute(sequenceStore: store);

            await store.AddAsync(new ChunkSequence("aaa", 10, context));

            await store.AddAsync(new ChunkSequence("bbb", 10, context));

            await store.AddAsync(new ChunkSequence("ccc", 10, context));

            await store.RemoveAsync("123");

            (await store.GetAsync <ChunkSequence>("aaa")).Should().NotBeNull();
            (await store.GetAsync <ChunkSequence>("bbb")).Should().NotBeNull();
            (await store.GetAsync <ChunkSequence>("ccc")).Should().NotBeNull();
        }
Ejemplo n.º 2
0
        public async Task Remove_ExistingSequence_SequenceRemoved()
        {
            var store   = new DefaultSequenceStore(new SilverbackLoggerSubstitute <DefaultSequenceStore>());
            var context = ConsumerPipelineContextHelper.CreateSubstitute(sequenceStore: store);

            await store.AddAsync(new ChunkSequence("aaa", 10, context));

            await store.AddAsync(new ChunkSequence("bbb", 10, context));

            await store.AddAsync(new ChunkSequence("ccc", 10, context));

            await store.RemoveAsync("bbb");

            (await store.GetAsync <ChunkSequence>("bbb")).Should().BeNull();
            (await store.GetAsync <ChunkSequence>("aaa")).Should().NotBeNull();
            (await store.GetAsync <ChunkSequence>("ccc")).Should().NotBeNull();
        }