예제 #1
0
        public void NoSequencesUsedBeforeIteration()
        {
            var first  = new ThrowingEnumerable();
            var second = new ThrowingEnumerable();
            var query  = first.Union(second);

            using (query.GetEnumerator())
            {
            }
        }
예제 #2
0
 public void NoSequencesUsedBeforeIteration()
 {
     var first = new ThrowingEnumerable();
     var second = new ThrowingEnumerable();
     // No exceptions!
     var query = first.Union(second);
     // Still no exceptions... we're not calling MoveNext.
     using (var iterator = query.GetEnumerator())
     {
     }
 }
예제 #3
0
파일: UnionTest.cs 프로젝트: mafm/edulinq
 public void FirstSequenceIsNotUsedUntilQueryIsIterated()
 {
     var first = new ThrowingEnumerable();
     int[] second = { 2 };
     var query = first.Union(second);
     using (var iterator = query.GetEnumerator())
     {
         // Still no exception... until we call MoveNext
         Assert.Throws<InvalidOperationException>(() => iterator.MoveNext());
     }
 }
예제 #4
0
        public void NoSequencesUsedBeforeIteration()
        {
            var first  = new ThrowingEnumerable();
            var second = new ThrowingEnumerable();
            // No exceptions!
            var query = first.Union(second);

            // Still no exceptions... we're not calling MoveNext.
            using (var iterator = query.GetEnumerator())
            {
            }
        }
예제 #5
0
        public void FirstSequenceIsNotUsedUntilQueryIsIterated()
        {
            var first = new ThrowingEnumerable();

            int[] second = { 2 };
            var   query  = first.Union(second);

            using (var iterator = query.GetEnumerator())
            {
                // Still no exception... until we call MoveNext
                Assert.Throws <InvalidOperationException>(() => iterator.MoveNext());
            }
        }