/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package testes.unidade;
import controllerTeste.AvaliacaoController;
import junit.framework.TestCase;
import model.Avaliacao;
/**
*
* @author Sheila
*/
public class AvaliacaoControllerTest extends TestCase {
public AvaliacaoControllerTest(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 AvaliacaoController.
*/
public void testGetNovoCodigo() {
System.out.println("AvaliacaoControllerTest - getNovoCodigo");
AvaliacaoController instance = new AvaliacaoController();
String expResult = "1";
String result = instance.getNovoCodigo();
assertEquals(expResult, result);
}
/**
* Test of getAvaliacao method, of class AvaliacaoController.
*/
public void testGetAvaliacao() {
System.out.println("AvaliacaoControllerTest - getAvaliacao");
String codigo = "1";
AvaliacaoController instance = new AvaliacaoController();
int expResult = 1;
int result = instance.getAvaliacao(codigo).getCodigoAvaliacao();
assertEquals(expResult, result);
}
/**
* Test of atualizar method, of class AvaliacaoController.
*/
public void testAtualizar() {
System.out.println("AvaliacaoControllerTest - atualizar");
String codigo = "1";
Avaliacao pAvaliacao = new Avaliacao();
pAvaliacao.setCodigoAvaliacao(Integer.parseInt(codigo));
AvaliacaoController instance = new AvaliacaoController();
boolean expResult = true;
boolean result = instance.atualizar(pAvaliacao);
assertEquals(expResult, result);
}
/**
* Test of salvar method, of class AvaliacaoController.
*/
public void testSalvar() {
System.out.println("AvaliacaoControllerTest - salvar");
String codigo = "1";
Avaliacao pAvaliacao = new Avaliacao();
pAvaliacao.setCodigoAvaliacao(Integer.parseInt(codigo));
AvaliacaoController instance = new AvaliacaoController();
boolean expResult = true;
boolean result = instance.salvar(pAvaliacao);
assertEquals(expResult, result);
}
/**
* Test of excluir method, of class AvaliacaoController.
*/
public void testExcluir() {
System.out.println("AvaliacaoControllerTest - excluir");
String pCodigoAvaliacao = "1";
AvaliacaoController instance = new AvaliacaoController();
boolean expResult = true;
boolean result = instance.excluir(pCodigoAvaliacao);
assertEquals(expResult, result);
}
/**
* Test of getAvaliador method, of class AvaliacaoController.
*/
public void testGetAvaliador() {
System.out.println("AvaliacaoControllerTest - getAvaliador");
String codigo = "1";
Avaliacao pAvaliacao = new Avaliacao();
pAvaliacao.setCodigoAvaliacao(Integer.parseInt(codigo));
int codigoAvaliador = 2;
AvaliacaoController instance = new AvaliacaoController();
String expResult = "Avaliador";
String result = instance.getAvaliador(pAvaliacao, codigoAvaliador);
assertEquals(expResult, result);
}
}