Package br.facet.tcc.pojo

Examples of br.facet.tcc.pojo.Curso


     * Test method for
     * {@link br.facet.tcc.impl.dao.DaoConfiguration#salvar(java.lang.Object)}.
     */
    @Test
    public final void testSalvar() throws DaoException {
        Curso curso = new Curso();

        curso.setDuracao(8);
        curso.setInstituicao(this.getInstituicaoDao().listar(Instituicao.class)
                .get(0));
        curso.setNome("Curso4");
        curso.setStatus(Status.ATIVO);

        Integer codigo = this.getCursoDao().salvar(curso);
        Assert.assertTrue("Curso nao foi salvo.", codigo > 0);
    }
View Full Code Here


     * {@link br.facet.tcc.impl.dao.DaoConfiguration#atualizar(java.lang.Object)}
     * .
     */
    @Test
    public final void testAtualizar() throws DaoException {
        Curso curso = this.getCursoDao().listar(Curso.class).get(0);
        String expected = curso.getNome();
        curso.setNome("Novo Nome");
        this.getCursoDao().atualizar(curso);
        String actual = this.getCursoDao().listar(Curso.class).get(0).getNome();
        Assert.assertNotSame("Cursos s�o diferentes", expected, actual);

    }
View Full Code Here

     */
    @Test
    public final void testExcluir() throws DaoException {
        int unexpected = this.getCursoDao().listar(Curso.class).size();

        Curso curso = this.getCursoDao().obterPorID(Curso.class, 4);

        this.getCursoDao().excluir(curso);

        int actual = this.getCursoDao().listar(Curso.class).size();

View Full Code Here

     * {@link br.facet.tcc.impl.dao.DaoConfiguration#pesquisar(java.lang.Object)}
     * .
     */
    @Test
    public final void testPesquisar() throws DaoException {
        Curso curso = new Curso();
        curso.setNome("%Novo Nome%");
        List<Curso> cursos = this.getCursoDao().pesquisar(curso);

        Assert.assertFalse(cursos.isEmpty());
    }
View Full Code Here

TOP

Related Classes of br.facet.tcc.pojo.Curso

Copyright © 2018 www.massapicom. 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.