def test_create_sequence_using_iterate(self): self.assertDictEqual( sources.iterate().to_dictionary(lambda k: k + 1, lambda k: k - 1), { 1: -1, 2: 0, 3: 1, 4: 2, 5: 3 })
def test_create_sequence_using_iterate(self): self.assertEqual(sources.iterate().max(), 4)
def test_create_sequence_using_iterate(self): self.assertTrue(sources.iterate().any_matches(lambda k: k % 10 != 0))
def test_create_sequence_using_iterate(self): self.assertTupleEqual(sources.iterate().statistics(), NumberStatistics(10, 5, 0, 4, 2))
def test_create_sequence_using_iterate(self): self.assertListEqual(sources.iterate().to_list(), [0, 1, 2, 3, 4])
def test_create_sequence_using_iterate(self): self.assertEqual(sources.iterate().join(','), '0,1,2,3,4')
def test_create_sequence_using_iterate(self): self.assertListEqual(sources.iterate().chunk(2).to_list(), [[0, 1], [2, 3], [4]])
def test_create_sequence_using_iterate(self): self.assertListEqual(forEachOpHelper(sources.iterate()), [0, 1, 2, 3, 4])