def test_get_number_with_longest_iteration_sequence_between_1_and_28_should_return_27(self): measurer = CollatzConjectureMeasurer() n = measurer.get_longest_sequence_number_between(1, 28) self.assertIs(n == 27, True, "Number with longest sequence was: " + str(n))
def test_get_number_of_iterations_starting_on_2_should_return_1(self): measurer = CollatzConjectureMeasurer() n = measurer.apply_collatz_conjecture(2) self.assertIs(n == 1, True, "Iteration number was: " + str(n))
def test_get_number_of_iterations_starting_on_negative_number_should_raise_value_error_exception(self): with self.assertRaises(ValueError): measurer = CollatzConjectureMeasurer() n = measurer.apply_collatz_conjecture(-1)