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); }
public async void ShouldWorkForMultipleKeys() { var sut = new MemoryBackedStreamPositionRepositoryForDebugging(); await sut.SetPositionForAsync("abc", 123); await sut.SetPositionForAsync("def", 456); var result = await sut.GetPositionForAsync("abc"); result.Should().Be(123); result = await sut.GetPositionForAsync("def"); result.Should().Be(456); }
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); }
public async void GetPositionFor_ShouldReturnNullWhenNoStreamCanBeFound() { var sut = new MemoryBackedStreamPositionRepositoryForDebugging(); var result = await sut.GetPositionForAsync("abc"); result.Should().NotHaveValue(); }