コード例 #1
0
        public void DisposeShouldStopServer()
        {
            var requestHandler = new DataCollectionTestCaseEventHandler(this.mockCommunicationManager.Object);

            requestHandler.Dispose();

            this.mockCommunicationManager.Verify(x => x.StopServer(), Times.Once);
        }
コード例 #2
0
        public void DisposeShouldThrowExceptionIfThrownByCommunicationManager()
        {
            this.mockCommunicationManager.Setup(x => x.StopServer()).Throws <Exception>();
            var requestHandler = new DataCollectionTestCaseEventHandler(this.mockCommunicationManager.Object);

            Assert.ThrowsException <Exception>(
                () =>
            {
                requestHandler.Dispose();
            });
        }