public void FetchChannelToWorkWith_WhenCalled_AsksPoolBorrow() { Service channel = new Service(); Expect.Call(pool.BorrowObject()).Return(channel); repo.ReplayAll(); var result = CreatePoolManager().FetchChannelToWorkWith(); Assert.AreSame(result, channel); }
/// <summary> /// Builds a new <see cref="PooledObjectHolder"/> /// trying to borrow an object form it /// </summary> /// <param name="pool"></param> private PooledObjectHolder(IObjectPool pool) { this.pool = pool; this.pooled = pool.BorrowObject(); }
/// <exception cref="System.Exception"></exception> public void Run() { pool.BorrowObject(); }
public void UsePool() { gotFromPool = objectPool.BorrowObject(); latch.Release(); }
/// <summary> /// Builds a new <see cref="PooledObjectHolder"/> /// trying to borrow an object form it /// </summary> /// <param name="pool"></param> private PooledObjectHolder(IObjectPool pool) { this.pool = pool; this.pooled = pool.BorrowObject(); }