示例#1
0
        public async Task ApplyThrowsArgumentNullExceptionWhenSourceSequenceIsNull()
        {
            IAsyncEnumerable <string> source = null;

            Exception exception = null;

            try
            {
                int length = 0;

                source.ShouldBeNull();

                await source.ApplyAsync(s => length += s.Length);
            }
            catch (Exception e)
            {
                exception = e;
            }

            exception.ShouldNotBeNull();

            exception.ShouldBeOfType <ArgumentNullException>();
        }