def test_last_empty_predicate(self): e = Enumerable.empty() result = e.last(lambda x: len(x)) self.assertIsNone(result)
def test_all_empty(self): e = Enumerable.empty() result = e.all(lambda x: False) self.assertTrue(result)
def test_last_empty_no_predicate(self): e = Enumerable.empty() result = e.last() self.assertIsNone(result)
def test_select_empty(self): e = Enumerable.empty() result = e.select(lambda x: x / 3).to_list() self.assertListEqual(result, [])
def test_any_empty(self): e = Enumerable.empty() result = e.any(lambda x: False) self.assertFalse(result)
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, [])