public void SingleOrNone_AppliedToFailingEnumerator_DoesNotThrow() { var sequence = new YieldElementsThenFail <string>("Hello world", 2); Assert.Throws <InvalidOperationException>(() => sequence.SingleOrNone()); Assert.Throws <AssertionException>(() => sequence.ToList()); }
public void FirstOrNone_AppliedToFailingEnumerator_DoesNotThrow() { var sequence = new YieldElementsThenFail <string>("Hello world", 1); var composition = sequence.FirstOrNone(); Assert.IsTrue(composition.IsSome); Assert.Throws <AssertionException>(() => sequence.ToList()); }