public void ShouldHandleClearAfterNoUsage()
        {
            var pool = new ParameterizedObjectPool <int, MyPooledObject>();

            pool.Clear();

            Assert.That(0, Is.EqualTo(pool.KeysInPoolCount));
        }
        public void ShouldHandleClearAfterSomeUsage()
        {
            var pool = new ParameterizedObjectPool <int, MyPooledObject>();

            using (var obj = pool.GetObject(1))
            {
            }

            pool.Clear();

            Assert.That(0, Is.EqualTo(pool.KeysInPoolCount));
        }
        public void ShouldHandleClearAndThenPoolCanBeUsedAgain()
        {
            var pool = new ParameterizedObjectPool <int, MyPooledObject>();

            using (var obj = pool.GetObject(1))
            {
            }

            pool.Clear();

            using (var obj = pool.GetObject(1))
            {
            }

            Assert.That(1, Is.EqualTo(pool.KeysInPoolCount));
        }
        public void ShouldHandleClearAndThenPoolCanBeUsedAgain()
        {
            var pool = new ParameterizedObjectPool<int, MyPooledObject>();

            using (var obj = pool.GetObject(1))
            {
            }

            pool.Clear();

            using (var obj = pool.GetObject(1))
            {
            }

            Assert.That(1, Is.EqualTo(pool.KeysInPoolCount));
        }
        public void ShouldHandleClearAfterSomeUsage()
        {
            var pool = new ParameterizedObjectPool<int, MyPooledObject>();

            using (var obj = pool.GetObject(1))
            {
            }

            pool.Clear();

            Assert.That(0, Is.EqualTo(pool.KeysInPoolCount));
        }
        public void ShouldHandleClearAfterNoUsage()
        {
            var pool = new ParameterizedObjectPool<int, MyPooledObject>();

            pool.Clear();

            Assert.That(0, Is.EqualTo(pool.KeysInPoolCount));
        }