public void DisposeShouldStopServer() { var requestHandler = new DataCollectionTestCaseEventHandler(this.mockCommunicationManager.Object); requestHandler.Dispose(); this.mockCommunicationManager.Verify(x => x.StopServer(), Times.Once); }
public void DisposeShouldThrowExceptionIfThrownByCommunicationManager() { this.mockCommunicationManager.Setup(x => x.StopServer()).Throws <Exception>(); var requestHandler = new DataCollectionTestCaseEventHandler(this.mockCommunicationManager.Object); Assert.ThrowsException <Exception>( () => { requestHandler.Dispose(); }); }