public void Dispose_CalledMultipleTimes_DoesNotThrow() { // Setup var mocks = new MockRepository(); var tileProvider = mocks.Stub <ITileProvider>(); mocks.ReplayAll(); var tileFetcher = new AsyncTileFetcher(tileProvider, 1, 2); // Call TestDelegate call = () => { tileFetcher.Dispose(); tileFetcher.Dispose(); }; // Assert Assert.DoesNotThrow(call); }
public void IsRead_TileFetcherDisposed_ThrowObjetDisposedException() { // Setup var mocks = new MockRepository(); var tileProvider = mocks.Stub <ITileProvider>(); mocks.ReplayAll(); var tileFetcher = new AsyncTileFetcher(tileProvider, 1, 2); tileFetcher.Dispose(); // Call TestDelegate call = () => tileFetcher.IsReady(); // Assert string objectName = Assert.Throws <ObjectDisposedException>(call).ObjectName; Assert.AreEqual("AsyncTileFetcher", objectName); mocks.VerifyAll(); }