コード例 #1
0
 def test_single_or_default4(self):
     linq = Linq([1, 2, 3, 4, 5])
     assert_equal(linq.single_or_default(cond_f=lambda x: x % 3 == 0), 3)
コード例 #2
0
 def test_single_or_default2(self):
     linq = Linq(tuple())
     assert_equal(linq.single_or_default(default=10), 10)
コード例 #3
0
 def test_single_or_default3(self):
     linq = Linq(tuple([1, 2]))
     linq.single_or_default(default=10)
コード例 #4
0
 def test_single_or_default(self):
     linq = Linq([1])
     assert_equal(linq.single_or_default(), 1)