Esempio n. 1
0
	def test_if_tuples_are_sorted_and_ascending_is_False_should_be_equal(self):
		start = [(1, 2), (2, 3)]
		end = [(2, 3), (1, 2)]
		result = sort_fraction(start,False)

		self.assertEqual(result,end)
Esempio n. 2
0
 def test_with_more_fractions(self):
     arr = [(5, 6), (22, 78), (22, 7), (7, 8), (9, 6), (15, 32)]
     res = sort_fraction(arr)
     self.assertEqual(res, [(22, 78), (15, 32), (5, 6), (7, 8), (9, 6),
                            (22, 7)])
Esempio n. 3
0
 def test_with_same_denominator(self):
     arr = [(2, 3), (1, 3)]
     res = sort_fraction(arr)
     self.assertEqual(res, [(1, 3), (2, 3)])
Esempio n. 4
0
 def test_with_three_fractions(self):
     arr = [(2, 3), (1, 2), (1, 3)]
     res = sort_fraction(arr)
     self.assertEqual(res, [(1, 3), (1, 2), (2, 3)])