Exemplo n.º 1
0
 def test_zero(self):
     ar_input = [0, 0, 0, 0, 0, 0, 0, 0, 0]
     k_input = 3
     output = (numberOfPairs(ar = ar_input, k = k_input)) 
     expected = 36      
     self.assertEqual(output, expected)
Exemplo n.º 2
0
 def test_random(self):
     ar_input = [34, 56, 67, 89, 56, 54, 75, 85, 22, 67, 89, 89, 86, 85, 43, 35, 55]
     k_input = 40
     output = (numberOfPairs(ar = ar_input, k = k_input)) 
     expected = 5      
     self.assertEqual(output, expected)
Exemplo n.º 3
0
 def test_sample2(self):
     ar_input = [1, 2, 3, 4, 5, 6]
     k_input = 5
     output = (numberOfPairs(ar = ar_input, k = k_input)) 
     expected = 3      
     self.assertEqual(output, expected)
Exemplo n.º 4
0
 def test_sample(self):
     ar_input = [1, 3 , 2, 6, 1, 2]
     k_input = 3
     output = (numberOfPairs(ar = ar_input, k = k_input)) 
     expected = 5      
     self.assertEqual(output, expected)
Exemplo n.º 5
0
 def test_one_number_list(self):
     ar_input = [5]
     k_input = 5
     output = (numberOfPairs(ar = ar_input, k = k_input)) 
     expected = 0      
     self.assertEqual(output, expected) 
Exemplo n.º 6
0
 def test_no_pairs(self):
     ar_input = [1, 1, 1, 1, 1, 1, 1, 1, 1]
     k_input = 5
     output = (numberOfPairs(ar = ar_input, k = k_input)) 
     expected = 0      
     self.assertEqual(output, expected)