コード例 #1
0
        public void WaitForRequestHandlerConnectionShouldWaitForConnectionToBeCompleted()
        {
            this.mockCommunicationManager.Setup(x => x.WaitForClientConnection(It.IsAny <int>())).Returns(true);

            var result = requestHandler.WaitForRequestHandlerConnection(10);

            Assert.IsTrue(result);
        }
コード例 #2
0
        public void WaitForRequestHandlerConnectionShouldThrowExceptionIfThrownByConnectionManager()
        {
            this.mockCommunicationManager.Setup(x => x.WaitForClientConnection(It.IsAny <int>())).Throws <Exception>();
            var requestHandler = new DataCollectionTestCaseEventHandler(this.mockCommunicationManager.Object);

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