Exemple #1
0
def test_compute_add():
    instruction = "add 2\napply 0"
    calculator = Calculator(instruction)
    assert calculator.Compute() == 2
Exemple #2
0
def test_compute_1():
    instruction = "multiply 3\nadd 2\napply 10"
    calculator = Calculator(instruction)
    assert calculator.Compute() == 32
Exemple #3
0
def test_compute_apply():
    instruction = "apply 1"
    calculator = Calculator(instruction)
    assert calculator.Compute() == 1
Exemple #4
0
def test_compute_divide():
    instruction = "divide 2\napply 4"
    calculator = Calculator(instruction)
    assert calculator.Compute() == 2
Exemple #5
0
def test_compute_multiply():
    instruction = "multiply 2\napply 1"
    calculator = Calculator(instruction)
    assert calculator.Compute() == 2
Exemple #6
0
def test_compute_subtract():
    instruction = "subtract 2\napply 4"
    calculator = Calculator(instruction)
    assert calculator.Compute() == 2