Exemplo n.º 1
0
    def test_division_by_zero(self):
        num1 = 10
        num2 = 0

        try:
            math.addition(num1, num2)
        except ZeroDivisionError:
            assert True
        except:
            assert False
Exemplo n.º 2
0
    def test_division_mix_numbers(self):
        num1 = -12
        num2 = 3

        result = math.addition(num1, num2)
        self.assertEquals(result, -9, "Is expected to have a result equal to -9.")
Exemplo n.º 3
0
    def test_addition_mix_numbers(self):
        num1 = -2
        num2 = 3

        result = math.addition(num1, num2)
        self.assertEquals(result, 1, "Is expected to have a result equal to 1.")
Exemplo n.º 4
0
    def test_addition_positive_numbers(self):
        num1 = 2
        num2 = 3

        result = math.addition(num1, num2)
        self.assertEquals(result, 5, "Is expected to have a result equal to 5.")
Exemplo n.º 5
0
    def test_addition_negative_numbers(self):
        num1 = -10
        num2 = -4

        result = math.addition(num1, num2)
        self.assertEquals(result, -14, "Is expected to have a result equal to -14.")