public void TestGetItem() { var o = new ObjectStub(); itemStoreMock.Expect(m => m.Count).Return(1); itemStoreMock.Expect(m => m.Fetch()).Return(o); var item = manager.GetItem(); Assert.AreEqual(o, item); }
public void TestAcquire() { var o = new ObjectStub(); managerMock.Expect(m => m.GetItem()).Return(o); Assert.AreEqual(o, pool.Acquire()); Assert.AreEqual(PoolSize - 1, pool.Count); }
public void TestRelease() { var o = new ObjectStub(); pool.Acquire(); managerMock.Expect(m => m.PutItem(o)); Assert.AreEqual(PoolSize, pool.Release(o)); Assert.AreEqual(PoolSize, pool.Count); }
public void TestPutItem() { var o = new ObjectStub(); itemStoreMock.Expect(m => m.Store(o)); manager.PutItem(o); }