Beispiel #1
0
        public async void ShouldWorkForMultipleSubscriberIds()
        {
            var sut = new MemoryBackedStreamPositionRepositoryForDebugging();
            await sut.SetPositionForAsync(StreamName, SubscriberId, 123);

            await sut.SetPositionForAsync(StreamName, "XYZ", 456);

            var result = await sut.GetPositionForAsync(StreamName, SubscriberId);

            result.Should().Be(123);

            result = await sut.GetPositionForAsync(StreamName, "XYZ");

            result.Should().Be(456);
        }
Beispiel #2
0
        public async void GetPositionFor_ShouldReturnStoredValueWhenNoStreamCanBeFound()
        {
            var sut = new MemoryBackedStreamPositionRepositoryForDebugging();
            await sut.SetPositionForAsync(StreamName, SubscriberId, 123);

            var result = await sut.GetPositionForAsync(StreamName, SubscriberId);

            result.Should().Be(123);
        }