public void TestCreatWithNoObjectsAndGet() { RegisterPoolAndAssertion <TypeOne>(1, 0); TypeOne obj = PoolFactory.GetObject <TypeOne>(); Assert.IsNotNull(obj); Assert.AreEqual(0, PoolFactory.GetPoolSize <TypeOne>()); PoolFactory.Recycle(ref obj); Assert.AreEqual(1, PoolFactory.GetPoolSize <TypeOne>()); }
public void TestRecycle() { RegisterPoolAndAssertion <TypeOne>(1); Assert.AreEqual(10, PoolFactory.GetPoolSize <TypeOne>()); TypeOne obj = PoolFactory.GetObject <TypeOne>(); Assert.AreEqual(9, PoolFactory.GetPoolSize <TypeOne>()); PoolFactory.Recycle(ref obj); Assert.AreEqual(10, PoolFactory.GetPoolSize <TypeOne>()); }