Ejemplo n.º 1
0
 def function(modulo):
     return multiply(547, 312, modulo)
Ejemplo n.º 2
0
 def test__multiply__when_modulo_is_positive_and_second_factor_is_negative(
 ):
     # when
     result = multiply(547, -312, 10000)
     # then
     assert_that(result).is_equal_to(9336)
Ejemplo n.º 3
0
 def test__multiply__when_modulo_is_positive_and_factors_are_negative():
     # when
     result = multiply(-547, -312, 10000)
     # then
     assert_that(result).is_equal_to(664)
Ejemplo n.º 4
0
 def test__multiply__when_factors_are_negative__then_result_is_positive():
     # when
     result = multiply(-3, -10)
     # then
     assert_that(result).is_equal_to(30)
Ejemplo n.º 5
0
 def test__multiply__when_first_factor_is_positive_and_second_factor_is_negative__then_result_is_negative(
 ):
     # when
     result = multiply(3, -10)
     # then
     assert_that(result).is_equal_to(-30)
Ejemplo n.º 6
0
 def test__multiply__when_factors_are_zero():
     # when
     result = multiply(0, 0)
     # then
     assert_that(result).is_equal_to(0)
Ejemplo n.º 7
0
 def test__multiply__when_second_factor_is_zero():
     # when
     result = multiply(14, 0)
     # then
     assert_that(result).is_equal_to(0)
Ejemplo n.º 8
0
 def test__multiply__when_first_factor_is_zero():
     # when
     result = multiply(0, 14)
     # then
     assert_that(result).is_equal_to(0)