public void Select() { var set = Enumerate.Return(1).Select(t => t + 1)(); Assert.AreEqual(2, set().Value); Assert.IsFalse(set().HasValue); }
public void Return() { var set = Enumerate.Return(1)(); Assert.AreEqual(1, set().Value); Assert.IsFalse(set().HasValue); }
public void ToEnumerable() { var set = Enumerate.Return(1).ToEnumerable(); Assert.AreEqual(1, set.Single()); }
public void ThrowSelectMany() { var set = Enumerate.Throw <int>(new InvalidOperationException("Epic Fail!")).SelectMany(t => Enumerate.Return(1))(); try { var v = set().Value; Assert.Fail("No exception thrown"); } catch (InvalidOperationException) { // Expected } }