예제 #1
0
        public void ShouldBeAbleToAddAndReleaseSireadLock()
        {
            string txId = Guid.NewGuid().ToString();

            Kvs.AddSiLock(Key, txId);

            var isExceptionRaised = false;

            try
            {
                Kvs.AddSiLock(Key, txId);
            }
            catch (StorageException)
            {
                isExceptionRaised = true;
            }

            Assert.IsTrue(isExceptionRaised);

            var siLocks = Kvs.GetTransactionsHoldingSiReadLocks(Key);

            Assert.AreEqual(siLocks.First(), txId);
        }