import unittest
from BASIC.src import basic


class TestEvaluate(unittest.TestCase):
    def setUp(self):
        self.b = basic
        self.b.memory = {"X": 2, "Y": 4}

    def test_numbers(self):
        expression = "1 + 1"
        expected = 2
        self.assertEqual(basic.evaluate(expression), expected)

    def test_equation(self):
        expression = "X * Y"
        expected = 8
        self.assertEqual(self.b.evaluate(expression), expected)

if __name__ == '__main__':
    unittest.main()
