public void Dispose()
        {
            ReaderWriterLockSlim rwls;

            rwls = new ReaderWriterLockSlim();
            rwls.Dispose();
            AssertExtensions.Throws <ObjectDisposedException>(() => rwls.TryEnterReadLock(0));
            AssertExtensions.Throws <ObjectDisposedException>(() => rwls.TryEnterUpgradeableReadLock(0));
            AssertExtensions.Throws <ObjectDisposedException>(() => rwls.TryEnterWriteLock(0));
            rwls.Dispose();

            for (int i = 0; i < 3; i++)
            {
                rwls = new ReaderWriterLockSlim();
                switch (i)
                {
                case 0: rwls.EnterReadLock(); break;

                case 1: rwls.EnterUpgradeableReadLock(); break;

                case 2: rwls.EnterWriteLock(); break;
                }
                AssertExtensions.Throws <SynchronizationLockException>(() => rwls.Dispose());
            }
        }