Пример #1
0
        public void FirstSequenceIsNotUsedUntilQueryIsIterated()
        {
            var query = new ThrowingEnumerable().Union(new[] { 1, 2 });

            using (var enumerator = query.GetEnumerator()) // No exception expected here
            {
                Assert.Throws(typeof(InvalidOperationException), () => enumerator.MoveNext());
            }
        }