public void IntersectSecondNonStreamingExecution() { Data <object> first = DummyData; LateThrowingData <object> second = LateThrowingData(); IEnumerable <object> enumerable = first.Intersect(second); Assert.Throws <LateThrownException>(() => enumerable.MoveNext()); // # Sequence was fully buffered, throwing LateThrownException after enumeration ended }
protected LateThrowingData <object> LateThrowingData() { object[] data = new object[] { "Late", "Throwing", "Data" }; LateThrowingData <object> dataEnumerable = new LateThrowingData <object>(data); DataEnumerables.Add((Data)dataEnumerable); return(dataEnumerable); }
public void IntersectFirstStreamingExecution() { LateThrowingData <object> first = LateThrowingData(); Data <object> second = Data <object>("Late", "Throwing"); IEnumerable <object> enumerable = first.Intersect(second); Assert.DoesNotThrow(() => enumerable.MoveNext()); // # LateThrownException was not thrown since sequence was not fully enumerated }
public void GroupJoinFirstStreamingExecution() { LateThrowingData <object> first = LateThrowingData(); Data <object> second = DummyData; IEnumerable <object> enumerable = first.GroupJoin(second, x => x, x => x, (x, y) => x); Assert.DoesNotThrow(() => enumerable.MoveNext()); // # LateThrownException was not thrown since sequence was not fully enumerated }
public void GroupJoinWithComparerSecondNonStreamingExecution() { Data <object> first = DummyData; LateThrowingData <object> second = LateThrowingData(); IEnumerable <object> enumerable = first.GroupJoin(second, x => x, x => x, (x, y) => x, EqualityComparer <object> .Default); Assert.Throws <LateThrownException>(() => enumerable.MoveNext()); // # Sequence was fully buffered, throwing LateThrownException after enumeration ended }
public void ExceptWithComparerFirstStreamingExecution() { LateThrowingData <object> first = LateThrowingData(); Data <object> second = DummyData; IEnumerable <object> enumerable = first.Except(second, EqualityComparer <object> .Default); Assert.DoesNotThrow(() => enumerable.MoveNext()); // # LateThrownException was not thrown since sequence was not fully enumerated }
public void JoinWithComparerFirstStreamingExecution() { LateThrowingData <object> first = LateThrowingData(); Data <object> second = Data <object>("Late", "Throwing"); IEnumerable <object> enumerable = first.Join(second, x => x, x => x, (x, y) => x, EqualityComparer <object> .Default); Assert.DoesNotThrow(() => enumerable.MoveNext()); // # LateThrownException was not thrown since sequence was not fully enumerated }