Exemple #1
0
 public void PoolCantHaveZeroCapacity()
 {
     Assert.ThrowsException <Pool <Test> .PoolException>(() =>
     {
         var _ = new GMTK.Pool <Test>(0);
     });
 }
Exemple #2
0
            public void PoolWillThrowErrorIfPollutedFromOutside()
            {
                Pool <Test> pool = new GMTK.Pool <Test>(100);
                var         test = new Test();

                Assert.ThrowsException <Pool <Test> .PoolException>(() =>
                {
                    pool.Release(ref test);
                });
            }
Exemple #3
0
            public void PoolWillThrowErrorIfExertedOverCapacity()
            {
                Pool <Test> pool = new GMTK.Pool <Test>(1);
                var         _    = pool.Acquire();

                Assert.ThrowsException <Pool <Test> .PoolException>(() =>
                {
                    var _ = pool.Acquire();
                });
            }