Exemplo n.º 1
0
    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 ---");
    }
Exemplo n.º 2
0
    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 ---");
    }