protected void TimeoutConsumerThreadProc()
{
try
{
timeoutConsumer.Receive();
}
catch(ArgumentOutOfRangeException e)
{
// The test failed. We will know because the timeout will expire inside TestNoTimeoutConsumer().
Assert.Fail("Test failed with exception: " + e.Message);
}
catch(ThreadInterruptedException)
{
// The test succeeded! We were still blocked when we were interrupted.
}
catch(Exception e)
{
// Some other exception occurred.
Assert.Fail("Test failed with exception: " + e.Message);
}
}