コード例 #1
0
 public void DivisionToZeroFoldTest()
 => ListMethods.Fold(list, (acc, element) => acc - element, 0);
コード例 #2
0
 public void DivisionFoldTest()
 {
     list.Remove(0);
     Assert.AreEqual(0, ListMethods.Fold(list, (acc, element) => acc / element, 0));
 }
コード例 #3
0
 public void MultipleOperationsFoldTest()
 {
     Assert.AreEqual(9692, ListMethods.Fold(list, (acc, element) => (acc - element) / 2, 0));
 }
コード例 #4
0
 public void SumSubstractionTest()
 => Assert.AreEqual(29219, ListMethods.Fold(list, (acc, element) => acc - element, 0));
コード例 #5
0
 public void SumFroFiveTest()
 => Assert.AreEqual(-29214, ListMethods.Fold(list, (acc, element) => acc + element, 5));
コード例 #6
0
 public void MultToZeroFoldTest()
 => Assert.AreEqual(ListMethods.Fold(list, (acc, element) => acc * element, 0), 0);
コード例 #7
0
 public void MultToOneFoldTest()
 => Assert.AreEqual(0, ListMethods.Fold(list, (acc, element) => acc * element, 1));
コード例 #8
0
 public void SumFoldTest()
 => Assert.AreEqual(-29219, ListMethods.Fold(list, (acc, element) => acc + element, 0));