def test_multiply(self):
        result = calc.multiply(4, 2)
        self.assertEqual(result, 8)

        result = calc.multiply(4, 0)
        self.assertEqual(result, 0)

        result = calc.multiply(4, -2)
        self.assertEqual(result, -8)
    def test_multiply_of_many(self):
        result = calc.multiply(4, 2, 1)
        self.assertEqual(result, 8)

        result = calc.multiply(4, 0)
        self.assertEqual(result, 0)

        result = calc.multiply(4, -2, 9)
        self.assertEqual(result, -72)

        result = calc.multiply(4, -2, -1)
        self.assertEqual(result, 8)

        result = calc.multiply(4, 2, 2, 2)
        self.assertEqual(result, 32)
예제 #3
0
def test_multiply():
    assert calculator.multiply(1, 2) == 2
    assert calculator.multiply(1, 2, 3, 4) == 24
def test_multiply_multiple():
    assert multiply(1,2,3,4) == 24
def test_multiply():
    assert multiply(1,2) == 2
def test_multiply_many_numbers():
	"""it can multiply lots of numbers"""
	assert simple_calculator.multiply(2, -3, 2, -3) == 36
def test_multiply_two_numbers():
	"""it can multiply 2 numbers"""
	assert simple_calculator.multiply(10, 2) == 20
예제 #8
0
def test_multiply():
    assert simple_calculator.multiply(0, 0) == 0
    assert simple_calculator.multiply(1, 2) == 2
    assert simple_calculator.multiply(4, 5) == 20
    assert simple_calculator.multiply(1, 2, 3) == 6
 def test_multiply(self):
     self.assertEqual(simple_calculator.multiply(6, 9), 54)
     self.assertEqual(simple_calculator.multiply(3.6, 2), 7.2)
     self.assertEqual(round(simple_calculator.multiply(-4.20, 13.37), 3),
                      -56.154)
def test_multiply():
    assert simple_calculator.multiply(1, 2) == 2
    assert simple_calculator.multiply(-1, -1) == 1
    assert simple_calculator.multiply(4, 5) == 20
    assert simple_calculator.multiply(1, 2, 3, 4) == 24
def test_multiply():
    result = multiply(1, 2, 3, 4)
    assert result == 24