Beispiel #1
0
 def function(modulo):
     return multiply(547, 312, modulo)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #6
0
 def test__multiply__when_factors_are_zero():
     # when
     result = multiply(0, 0)
     # then
     assert_that(result).is_equal_to(0)
Beispiel #7
0
 def test__multiply__when_second_factor_is_zero():
     # when
     result = multiply(14, 0)
     # then
     assert_that(result).is_equal_to(0)
Beispiel #8
0
 def test__multiply__when_first_factor_is_zero():
     # when
     result = multiply(0, 14)
     # then
     assert_that(result).is_equal_to(0)