<reponame>LucasCVilasBoas/testrail_pilot
import adder
from pytest_testrail.plugin import pytestrail
import pytest


# Testing sum function
@pytestrail.case('T1')
def test_add_two_positive_numbers():
    assert adder.add_two_numbers(1, 1) == 2

@pytestrail.case('T2')
def test_add_two_negative_numbers():
    assert adder.add_two_numbers(-1, -1) == -2

@pytestrail.case('T3')
def test_add_two_numbers_positive_and_negative():
    assert adder.add_two_numbers(-1, 1) == 0

@pytestrail.case('T4')
def test_add_two_numbers_positive_and_zero():
    assert adder.add_two_numbers(1, 0) == 1

@pytestrail.case('T5')
def test_add_two_numbers_negative_and_zero():
    assert adder.add_two_numbers(-1, 0) == -1


# Testing subtraction function
@pytestrail.case('T6')
def test_subtract_two_positive_numbers():
    assert adder.subtract_two_numbers(1, 1) == 0

@pytestrail.case('T7')
def test_subtract_two_negative_numbers():
    assert adder.subtract_two_numbers(-1, -1) == 0

@pytestrail.case('T8')
def test_subtract_two_numbers_positive_and_negative():
    assert adder.subtract_two_numbers(-1, 1) == -2

@pytestrail.case('T9')
def test_subtract_two_numbers_positive_and_zero():
    assert adder.subtract_two_numbers(1, 0) == 1

@pytestrail.case('T10')
def test_subtract_two_numbers_negative_and_zero():
    assert adder.subtract_two_numbers(-1, 0) == -1


# Testing multiplication function
@pytestrail.case('T11')
def test_multiply_two_positive_numbers():
    assert adder.multiply_two_numbers(2, 2) == 4

@pytestrail.case('T12')
def test_multiply_two_negative_numbers():
    assert adder.multiply_two_numbers(-2, -2) == 4

@pytestrail.case('T13')
def test_multiply_two_numbers_positive_and_negative():
    assert adder.multiply_two_numbers(-2, 2) == -4

@pytestrail.case('T14')
def test_multiply_two_numbers_positive_and_zero():
    assert adder.multiply_two_numbers(2, 0) == 0

@pytestrail.case('T15')
def test_multiply_two_numbers_negative_and_zero():
    assert adder.multiply_two_numbers(-1, 0) == 0


# Testing multiplication function
@pytestrail.case('T16')
def test_divide_two_positive_numbers():
    assert adder.divide_two_numbers(2, 2) == 1

@pytestrail.case('T17')
def test_divide_two_negative_numbers():
    assert adder.divide_two_numbers(-2, -2) == 1

@pytestrail.case('T18')
def test_divide_two_numbers_positive_and_negative():
    assert adder.divide_two_numbers(-2, 2) == -1

@pytestrail.case('T19')
def test_divide_two_numbers_negative_and_positive():
    assert adder.divide_two_numbers(2, -2) == -1

@pytestrail.case('T20')
@pytest.mark.skip(reason="no way of currently testing this")
def test_divide_two_numbers_positive_and_zero():
    with pytest.raises(Exception):
        assert adder.divide_two_numbers(2, 0)

@pytestrail.case('T21')
@pytest.mark.skip(reason="no way of currently testing this")
def test_divide_two_numbers_negative_and_zero():
    with pytest.raises(Exception):
        assert adder.divide_two_numbers(-2, 0)
