Exemple #1
0
 def test_last_empty_predicate(self):
     e = Enumerable.empty()
     result = e.last(lambda x: len(x))
     self.assertIsNone(result)
Exemple #2
0
 def test_all_empty(self):
     e = Enumerable.empty()
     result = e.all(lambda x: False)
     self.assertTrue(result)
Exemple #3
0
 def test_last_empty_no_predicate(self):
     e = Enumerable.empty()
     result = e.last()
     self.assertIsNone(result)
Exemple #4
0
 def test_select_empty(self):
     e = Enumerable.empty()
     result = e.select(lambda x: x / 3).to_list()
     self.assertListEqual(result, [])
Exemple #5
0
 def test_any_empty(self):
     e = Enumerable.empty()
     result = e.any(lambda x: False)
     self.assertFalse(result)
Exemple #6
0
 def test_take_empty(self):
     e = Enumerable.empty()
     result = list(e.take(3))
     expected_result = []
     self.assertListEqual(result, expected_result)
 def test_select_many_empty_with_predicate(self):
     e = Enumerable.empty()
     result = e.select_many(lambda x: x[0]).to_list()
     self.assertListEqual(result, [])
 def test_select_many_empty(self):
     e = Enumerable.empty()
     result = e.select_many().to_list()
     self.assertListEqual(result, [])