Example #1
0
 def test_where2(self):
     linq1 = Linq([1])
     linq2 = Linq([1, 1, 2, 3, 5])
     assert_equal(linq1.where(), Linq([1]))
     assert_equal(linq2.where(), Linq([1, 1, 2, 3, 5]))
Example #2
0
 def test_where(self):
     linq1 = Linq([1])
     linq2 = Linq([1, 1, 2, 3, 5])
     assert_equal(linq1.where(lambda x: x % 2 == 1), Linq([1]))
     assert_equal(linq2.where(lambda x: x % 2 == 0), Linq([2]))