Package testes.unidade

Source Code of testes.unidade.EnderecoControllerTest

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

package testes.unidade;

import controllerTeste.EnderecoController;
import junit.framework.TestCase;
import model.Endereco;

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

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

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

    /**
     * Test of getEndereco method, of class EnderecoController.
     */
    public void testGetEndereco() {
        System.out.println("EnderecoControllerTest - getEndereco");
        String codigo = "1";
        EnderecoController instance = new EnderecoController();
        int expResult = 1;
        int result = instance.getEndereco(codigo).getPessoa().getCodigoPessoa();
        assertEquals(expResult, result);
    }

    /**
     * Test of atualizar method, of class EnderecoController.
     */
    public void testAtualizar() {
        System.out.println("EnderecoControllerTest - atualizar");
        String codigo = "1";
        Endereco pEndereco = new Endereco();
        pEndereco.setCodigoEndereco(Integer.parseInt(codigo));
        EnderecoController instance = new EnderecoController();
        boolean expResult = true;
        boolean result = instance.atualizar(pEndereco);
        assertEquals(expResult, result);
    }

    /**
     * Test of salvar method, of class EnderecoController.
     */
    public void testSalvar() {
        System.out.println("EnderecoControllerTest - salvar");
        String codigo = "1";
        Endereco pEndereco = new Endereco();
        pEndereco.setCodigoEndereco(Integer.parseInt(codigo));
        EnderecoController instance = new EnderecoController();
        boolean expResult = true;
        boolean result = instance.salvar(pEndereco);
        assertEquals(expResult, result);
    }

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

Related Classes of testes.unidade.EnderecoControllerTest

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.