void Method2(GenericObjectPool <TestPoolAllocation> pool) { Console.WriteLine("--- Start Method2 ---"); NUnit.Framework.Assert.AreEqual(0, pool.NumActive); TestPoolAllocation obj = pool.GetObject(); NUnit.Framework.Assert.AreEqual(100, obj.Identifier); NUnit.Framework.Assert.AreEqual(1, pool.NumActive); //Console.WriteLine( "Object (" + obj.ToString() + ")"); Console.WriteLine("--- End Method2 ---"); }
void Method1(GenericObjectPool <TestPoolAllocation> pool) { Console.WriteLine("--- Start Method1 ---"); TestPoolAllocation obj = pool.GetObject(); obj.Identifier = 100; NUnit.Framework.Assert.AreEqual(1, pool.NumActive); //Console.WriteLine( "Object (" + obj.ToString() + ")"); //Console.WriteLine( "IsNullWeakReference (" + obj.IsNullWeakReference() + ")"); //Console.WriteLine( "Equal (" + Object.ReferenceEquals( pool, obj.Target) + ")"); Console.WriteLine("--- End Method1 ---"); }