Esempio n. 1
0
        public async Task ProcessMessage_Should_Throw_IfCancellationRequested()
        {
            // arrange
            var token   = new CancellationTokenSource();
            var message = new TestMessage();

            // act
            token.Cancel();

            // assert
            await Assert.ThrowsAsync <OperationCanceledException>(() => _target.ProcessMessage(message, token.Token));
        }