コード例 #1
0
        public void GetChannel_should_throw_when_not_initialized(
            [Values(false, true)]
            bool async)
        {
            Action act;

            if (async)
            {
                act = () => _subject.GetChannelAsync(CancellationToken.None).GetAwaiter().GetResult();
            }
            else
            {
                act = () => _subject.GetChannel(CancellationToken.None);
            }

            act.ShouldThrow <InvalidOperationException>();
        }
コード例 #2
0
        public void GetChannelAsync_should_throw_when_not_initialized()
        {
            Action act = () => _subject.GetChannelAsync(CancellationToken.None).Wait();

            act.ShouldThrow <InvalidOperationException>();
        }