Ariadne.NUnitTests.PoolTests.DefaultFactory C# (CSharp) 메소드

DefaultFactory() 개인적인 메소드

private DefaultFactory ( ) : void
리턴 void
        public void DefaultFactory()
        {
            bool called = false;
            var pool = new Pool<int>(() => {
                                         called = true;
                                         return 3;
                                     });
            pool.Store(2);
            Assert.AreEqual(2, pool.Get());
            Assert.IsFalse(called);
            Assert.AreEqual(3, pool.Get());
            Assert.IsTrue(called);
        }