import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.AfterEach;

import static org.junit.jupiter.api.Assertions.*;

class CalculatriceBasicOperationsTest {

    private Calculatrice calculatrice;

    @BeforeEach
    void setUp() {
        calculatrice = new Calculatrice();
        System.out.println("Initialisation de la calculatrice.");
    }

    @AfterEach
    void tearDown() {
        calculatrice = null;
        System.out.println("Nettoyage terminé.");
    }

    @Test
    void testAddition() {
        int resultat = calculatrice.addition(10, 5);
        assertEquals(15, resultat, "L'addition de 10 et 5 doit donner 15");
    }

    @Test
    void testSoustraction() {
        int resultat = calculatrice.soustraction(10, 5);
        assertEquals(5, resultat, "La soustraction de 10 et 5 doit donner 5");
    }
}
