def test_create_sequence_using_of(self): self.assertDictEqual( sources.of().to_dictionary(lambda k: k, lambda k: k * 2), { 0: 0, 1: 2, 2: 4, 3: 6 })
def test_create_sequence_using_of(self): self.assertEqual(sources.of().max(), 3)
def test_create_sequence_using_of(self): self.assertTrue(sources.of().any_matches(lambda k: k - k == 0))
def test_create_sequence_using_of(self): self.assertEqual(sources.of().average(), 1.5)
def test_create_sequence_using_of(self): self.assertTupleEqual(sources.of().statistics(), NumberStatistics(6, 4, 0, 3, 1.5))
def test_create_sequence_using_of(self): self.assertListEqual(sources.of().to_list(), [0, 1, 2, 3])
def test_create_sequence_using_of(self): self.assertEqual(sources.of().join(), '0123')
def test_create_sequence_using_of(self): self.assertListEqual(forEachOpHelper(sources.of()), [0, 1, 2, 3])