public void SumSomeProjected() { Assert.AreEqual(55, FEnumerable.Range(0, 10).Sum(x => x + 1)); }
public void AverageEmpty() { Assert.AreEqual(0, FEnumerable.Empty <int>().Average()); }
public void SumReturn() { Assert.AreEqual(42, FEnumerable.Return(42).Sum()); }
public void SumSome() { Assert.AreEqual(45, FEnumerable.Range(0, 10).Sum()); }
public void MaxEmpty() { Assert.IsFalse(FEnumerable.Empty <int>().Max().HasValue); }
public void RepeatOutOfRange() { FEnumerable.Repeat(0, -1); }
public void AnySome() { Assert.IsTrue(FEnumerable.Range(0, 10).Any(x => x < 10)); Assert.IsFalse(FEnumerable.Range(0, 10).Any(x => x > 10)); Assert.IsTrue(FEnumerable.Range(0, 10).Any(x => x == 5)); }
public void AverageSomeProjected() { Assert.AreEqual(5.5, FEnumerable.Range(0, 10).Average(x => x + 1)); }
public void Cast() { int n = 1; Assert.AreEqual(n, FEnumerable.Return((object)n).Cast <int>()()().Value); }
public void AnyReturn() { Assert.IsTrue(FEnumerable.Return(1).Any(x => x == 1)); Assert.IsFalse(FEnumerable.Return(1).Any(x => x == 0)); }
public void TakeOutOfRange() { FEnumerable.Return(1).Take(-1); }
public void SkipOutOfRange() { FEnumerable.Return(1).Skip(-1); }
public void RangeOutOfRange() { FEnumerable.Range(0, -1); }
public void AverageReturn() { Assert.AreEqual(42, FEnumerable.Return(42).Average()); }
public void ContainsEmpty() { Assert.IsFalse(FEnumerable.Empty <int>().Contains(42)); }
public void AverageSome() { Assert.AreEqual(4.5, FEnumerable.Range(0, 10).Average()); }
public void ContainsReturn() { int n = 42; Assert.IsTrue(FEnumerable.Return(n).Contains(n)); }
public void MinEmptyProjected() { Assert.IsFalse(FEnumerable.Empty <int>().Min(x => x + 1).HasValue); }
public void SumEmpty() { Assert.AreEqual(0, FEnumerable.Empty <int>().Sum()); }
public void MaxReturn() { int n = 42; Assert.AreEqual(n, FEnumerable.Return(n).Max().Value); }
public void Empty() { Assert.IsTrue(FEnumerable.Empty <int>()()() is Maybe <int> .None); }