Package testes.unidade

Source Code of testes.unidade.DocenteControllerTest

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package testes.unidade;

import controllerTeste.DocenteController;
import junit.framework.TestCase;
import model.Docente;

/**
*
* @author Marlon
*/
public class DocenteControllerTest extends TestCase {
   
    public DocenteControllerTest(String testName) {
        super(testName);
    }           

    @Override
    protected void setUp() throws Exception {
        super.setUp();
    }

    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
    }

    /**
     * Test of getNovoCodigo method, of class DocenteController.
     */
    public void testGetNovoCodigo() {
        System.out.println("DocenteControllerTest - getNovoCodigo");
        DocenteController instance = new DocenteController();
        String expResult = "1";
        String result = instance.getNovoCodigo();
        assertEquals(expResult, result);
    }

    /**
     * Test of getDocente method, of class DocenteController.
     */
    public void testGetDocente() {
        System.out.println("DocenteControllerTest - getDocente");
        String codigo = "1";
        DocenteController instance = new DocenteController();
        int expResult = 1;
        int result = instance.getDocente(codigo).getCodigoDocente();
        assertEquals(expResult, result);
    }

    /**
     * Test of atualizar method, of class DocenteController.
     */
    public void testAtualizar() {
        System.out.println("DocenteControllerTest - atualizar");
        String codigo = "1";
        Docente pDocente = new Docente();
        pDocente.setCodigoDocente(Integer.parseInt(codigo));
        DocenteController instance = new DocenteController();
        boolean expResult = true;
        boolean result = instance.atualizar(pDocente);
        assertEquals(expResult, result);
    }

    /**
     * Test of salvar method, of class DocenteController.
     */
    public void testSalvar() {
        System.out.println("DocenteControllerTest - salvar");
        String codigo = "1";
        Docente pDocente = new Docente();
        pDocente.setCodigoDocente(Integer.parseInt(codigo));
        DocenteController instance = new DocenteController();
        boolean expResult = true;
        boolean result = instance.salvar(pDocente);
        assertEquals(expResult, result);
    }

    /**
     * Test of excluir method, of class DocenteController.
     */
    public void testExcluir() {
        System.out.println("DocenteControllerTest - excluir");
        String codigo = "1";
        DocenteController instance = new DocenteController();
        boolean expResult = true;
        boolean result = instance.excluir(codigo);
        assertEquals(expResult, result);
    }

    /**
     * Test of cancelarAprovacao method, of class DocenteController.
     */
    public void testCancelarAprovacao() {
        System.out.println("DocenteControllerTest - cancelarAprovacao");
        String codigo = "1";
        DocenteController instance = new DocenteController();
        boolean expResult = true;
        boolean result = instance.cancelarAprovacao(codigo);
        assertEquals(expResult, result);
    }
}
TOP

Related Classes of testes.unidade.DocenteControllerTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.