예제 #1
0
 def test_select_many_deafult_selector(self):
     e = Enumerable([range(3) for i in range(3)])
     result = e.select_many().to_list()
     self.assertListEqual(result, [0, 1, 2, 0, 1, 2, 0, 1, 2])
예제 #2
0
 def test_select_many_empty_sub_collections(self):
     e = Enumerable([[], [], {}, (), range(0)])
     result = e.select_many().to_list()
     self.assertListEqual(result, [])
예제 #3
0
 def test_select_many_empty_list(self):
     e = Enumerable([])
     result = e.select_many().to_list()
     self.assertListEqual(result, [])
예제 #4
0
 def test_select_many_with_selector(self):
     e = Enumerable([('a', [1, 2]), ('b', [3, 4])])
     result = e.select_many(lambda x: x[1]).to_list()
     self.assertListEqual(result, [1, 2, 3, 4])