public virtual void Return_Already_Disposed() { // Arrange MockInnerPool.Setup(inner => inner.Dispose()); MockManagedPool.Setup(managed => managed.Clear()).Returns(true); DecoratedPool.Dispose(); // Act var result = DecoratedPool.Return(null); // Assert Assert.False(result); }
public override void Return_Already_Disposed() { // Arrange MockInnerPool.Setup(inner => inner.Take(null)).Returns((string)null); MockInnerPool.Setup(inner => inner.Count).Returns(0); MockInnerPool.Setup(inner => inner.Dispose()); DecoratedPool.Dispose(); // Act var result = DecoratedPool.Return(null); // Assert Assert.False(result); }
public override void Return_Already_Disposed() { // Arrange var items = new Queue <string>(new string[] { "x", "x", null }); MockInnerPool.Setup(inner => inner.Take(null)).Returns(items.Dequeue); MockInnerPool.Setup(inner => inner.Count).Returns(0); MockInnerPool.Setup(inner => inner.Dispose()); DecoratedPool.Dispose(); // Act var result = DecoratedPool.Return(null); // Assert Assert.False(result); }