Package testes.unidade

Source Code of testes.unidade.ContatoControllerTest

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

package testes.unidade;

import controllerTeste.ContatoController;
import junit.framework.TestCase;
import model.Contato;

/**
*
* @author Marlon
*/
public class ContatoControllerTest extends TestCase {
   
    public ContatoControllerTest(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 ContatoController.
     */
    public void testGetNovoCodigo() {
        System.out.println("ContatoControllerTest - getNovoCodigo");
        ContatoController instance = new ContatoController();
        String expResult = "1";
        String result = instance.getNovoCodigo();
        assertEquals(expResult, result);
    }

    /**
     * Test of getContato method, of class ContatoController.
     */
    public void testGetContato() {
        System.out.println("ContatoControllerTest - getContato");
        String codigo = "1";
        ContatoController instance = new ContatoController();
        int expResult = 1;
        int result = instance.getContato(codigo).getCodigoContato();
        assertEquals(expResult, result);
    }

    /**
     * Test of atualizar method, of class ContatoController.
     */
    public void testAtualizar() {
        System.out.println("ContatoControllerTest - atualizar");
        String codigo = "1";
        Contato pContato = new Contato();
        pContato.setCodigoContato(Integer.parseInt(codigo));
        ContatoController instance = new ContatoController();
        boolean expResult = true;
        boolean result = instance.atualizar(pContato);
        assertEquals(expResult, result);
    }

    /**
     * Test of salvar method, of class ContatoController.
     */
    public void testSalvar() {
        System.out.println("ContatoControllerTest - salvar");
        String codigo = "1";
        Contato pContato = new Contato();
        pContato.setCodigoContato(Integer.parseInt(codigo));
        ContatoController instance = new ContatoController();
        boolean expResult = true;
        boolean result = instance.salvar(pContato);
        assertEquals(expResult, result);
    }

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

}
TOP

Related Classes of testes.unidade.ContatoControllerTest

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.