@Test public void testSalvarMateria() { System.out.println("SalvarMateria"); Materia materia = new Materia(11, "Teste"); MateriaRepository instance = new MateriaRepository(); instance.SalvarMateria(materia); Materia result = instance.BuscarMateria(materia.Descricao()); assertEquals(materia.Id(), result.Id()); }
@Test public void testAlterarMateriaDeveRetornarTrue() { System.out.println("AlterarMateria"); MateriaRepository instance = new MateriaRepository(); Materia materia = instance.BuscarMateria("LPII"); materia.Descricao("LP2"); boolean ret = instance.AlterarMateria(materia); assertEquals(true, ret); materia = instance.BuscarMateria("LP2"); materia.Descricao("LPII"); ret = instance.AlterarMateria(materia); }