コード例 #1
0
        public void SingleOrNone_AppliedToFailingEnumerator_DoesNotThrow()
        {
            var sequence = new YieldElementsThenFail <string>("Hello world", 2);

            Assert.Throws <InvalidOperationException>(() => sequence.SingleOrNone());
            Assert.Throws <AssertionException>(() => sequence.ToList());
        }
コード例 #2
0
        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());
        }