/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package Logica;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;

/**
 *
 * @author André
 */
public class ModuloSimplesTest {
    
    public ModuloSimplesTest() {
    }
    
    @BeforeClass
    public static void setUpClass() {
    }
    
    @AfterClass
    public static void tearDownClass() {
    }
    
    @Before
    public void setUp() {
    }
    
    @After
    public void tearDown() {
    }

    /**
     * Test of converte method, of class ModuloSimples.
     */
    @Test
    public void testConverte1() {
        System.out.println("converte1");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("5");
        int result = instance.converte();
        int expResult = 5;
        assertEquals(expResult, result);
    }
    
    @Test
    public void testConverte2() {
        System.out.println("converte2");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("-1");
        int result = instance.converte();
        int expResult = -1;
        assertEquals(expResult, result);
    }
    
    @Test
    public void testConverte3() {
        System.out.println("converte3");
        ModuloSimples instance = new ModuloSimples();
        int result = instance.converte();
        int expResult = 0;
        assertEquals(expResult, result);
    }
    
    @Test
    public void testConverte4() {
        System.out.println("converte4");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("234");
        instance.converte();
        String res = instance.getActual();
        String expResult = "";
        assertEquals(expResult, res);
    }

    /**
     * Test of actualAdd method, of class ModuloSimples.
     */
    @Test
    public void testActualAdd1() {
        System.out.println("actualAdd1");
        String s = "";
        ModuloSimples instance = new ModuloSimples();
        instance.actualAdd(s);
        String expectedResult = "";
        assertEquals(expectedResult, instance.getActual());
    }
    
    @Test
    public void testActualAdd2() {
        System.out.println("actualAdd2");
        String s = "teste";
        ModuloSimples instance = new ModuloSimples();
        instance.actualAdd(s);
        String expectedResult = "teste";
        assertEquals(expectedResult, instance.getActual());
    }

    @Test
    public void testActualAdd3() {
        System.out.println("actualAdd3");
        String s = "1";
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("2");
        instance.actualAdd(s);
        String expectedResult = "21";
        assertEquals(expectedResult, instance.getActual());
    }
    
    public void testActualAdd4() {
        System.out.println("actualAdd4");
        String s = "";
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("2");
        instance.actualAdd(s);
        String expectedResult = "2";
        assertEquals(expectedResult, instance.getActual());
    }
    
    /**
     * Test of igual method, of class ModuloSimples.
     */
    @Test
    public void testIgual1() {
        System.out.println("igual1");
        ModuloSimples instance = new ModuloSimples();
        instance.setNum1(2);
        instance.setNum2(3);
        instance.setOpr('+');
        int res = instance.igual();
        int expResult = 5;
        assertEquals(expResult, res);
    }
    
    @Test
    public void testIgual2() {
        System.out.println("igual2");
        ModuloSimples instance = new ModuloSimples();
        instance.setNum1(2);
        instance.setNum2(3);
        int res = instance.igual();
        int expResult = 5;
        assertEquals(expResult, res);
    }
    
    @Test
    public void testIgual3() {
        System.out.println("igual3");
        ModuloSimples instance = new ModuloSimples();
        instance.setNum1(2);
        int res = instance.igual();
        int expResult = 2;
        assertEquals(expResult, res);
    }
    
    @Test
    public void testIgual4() {
        System.out.println("igual4");
        ModuloSimples instance = new ModuloSimples();
        instance.setNum2(3);
        int res = instance.igual();
        int expResult = 3;
        assertEquals(expResult, res);
    }
    
    public void testIgual5() {
        System.out.println("igual5");
        ModuloSimples instance = new ModuloSimples();
        int res = instance.igual();
        int expResult = 0;
        assertEquals(expResult, res);
    }

    /**
     * Test of clear method, of class ModuloSimples.
     */
    @Test
    public void testClear1() {
        System.out.println("clear1");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("teste");
        instance.clear();
        String expectedResult = "";
        assertEquals(expectedResult, instance.getActual());
    }
    
    @Test
    public void testClear2() {
        System.out.println("clear2");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("");
        instance.clear();
        String expectedResult = "";
        assertEquals(expectedResult, instance.getActual());
    }
    
    @Test
    public void testClear3() {
        System.out.println("clear3");
        ModuloSimples instance = new ModuloSimples();
        instance.clear();
        String expectedResult = "";
        assertEquals(expectedResult, instance.getActual());
    }

    /**
     * Test of del method, of class ModuloSimples.
     */
    @Test
    public void testDel1() {
        System.out.println("del1");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("teste");
        instance.del();
        String expectedResult = "test";
        assertEquals(expectedResult, instance.getActual());
    }
    
    @Test
    public void testDel2() {
        System.out.println("del2");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("");
        instance.del();
        String expectedResult = "";
        assertEquals(expectedResult, instance.getActual());
    }
    
    @Test
    public void testDel3() {
        System.out.println("del3");
        ModuloSimples instance = new ModuloSimples();
        instance.setActual("2");
        instance.del();
        String expectedResult = "";
        assertEquals(expectedResult, instance.getActual());
    }
    
    @Test
    public void testDel4() {
        System.out.println("del4");
        ModuloSimples instance = new ModuloSimples();
        instance.del();
        String expectedResult = "";
        assertEquals(expectedResult, instance.getActual());
    }
    
}
