Example #1
0
        public void TestDispose()
        {
            var o = MockRepository.GenerateMock <ObjectStub>();

            o.Expect(m => m.Dispose());

            itemStoreMock.Expect(m => m.Count).Return(1).Repeat.Once();
            itemStoreMock.Expect(m => m.Fetch()).Return(o);
            itemStoreMock.Expect(m => m.Count).Return(0);

            manager.Dispose();
            o.VerifyAllExpectations();
        }
Example #2
0
        public void Dispose()
        {
            lock (manager)
            {
                if (IsDisposed)
                {
                    return;
                }

                IsDisposed = true;
                manager.Dispose();
            }
            poolSemaphore.Close();
        }