Ejemplo n.º 1
0
        public async void GetPositionFor_ShouldReturnNullWhenNoStreamCanBeFound()
        {
            var sut    = new MemoryBackedStreamPositionRepositoryForDebugging();
            var result = await sut.GetPositionForAsync(StreamName, SubscriberId);

            result.Should().NotHaveValue();
        }
Ejemplo n.º 2
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);
        }