Exemplo n.º 1
0
        public void ReleaseKeyLock_HappyPath_CompletesSucessfully(int locksCount, uint keyBucket)
        {
            var sut = new ConcurrencyHelper(locksCount);

            var releaseKeyLock = sut
                                 .Invoking(s => s.ReleaseKeyLock(keyBucket))
                                 .Should().NotThrow();
        }
Exemplo n.º 2
0
        public void ReleaseKeyLock_BucketIsOutOfLocksRange_ThrowsException(int locksCount, uint keyBucket)
        {
            var sut = new ConcurrencyHelper(locksCount);

            var releaseKeyLock = sut
                                 .Invoking(s => s.ReleaseKeyLock(keyBucket))
                                 .Should()
                                 .Throw <ArgumentException>().WithMessage("Key bucket is out of locks range (Parameter 'keyBucket')");
        }