示例#1
0
  @Test
  public void comentarComVideo() {

    Comentario coment1 = new Comentario(null, videoComent1, 123, "idNot", "comentId");

    assertNotNull(coment1.getFile());
    assertEquals(videoComent1, coment1.getFile());
    assertNull(coment1.getTexto());
    assertEquals(123, coment1.getIdUsuario());
    assertEquals("idNot", coment1.getIdNotificao());
    assertEquals("comentId", coment1.getId());

    Comentario coment2 = new Comentario("Realmente", videoComent2, 321, "idNot", "comentId2");
    assertNotNull(coment2.getFile());
    assertEquals(videoComent2, coment2.getFile());
    assertNotNull(coment2.getTexto());
    assertEquals("Realmente", coment2.getTexto());
    assertEquals(321, coment1.getIdUsuario());
    assertEquals("idNot", coment1.getIdNotificao());
    assertEquals("comentId2", coment2.getId());
  }
示例#2
0
  @Test
  public void comentarSomenteTexto() throws ComentarioNaoDeveSerEnviado {

    Comentario coment1 =
        new Comentario("eu vi o acidente, o rapaz esta no HGCH", null, 890, "idNot", "comentId");

    assertNull(coment1.getFile());
    assertNotNull(coment1.getTexto());
    assertEquals("eu vi o acidente, o rapaz esta no HGCH", coment1.getTexto());
    assertEquals(890, coment1.getIdUsuario());
    assertEquals("idNot", coment1.getIdNotificao());
    assertEquals("comentId", coment1.getId());

    Comentario coment2 =
        new Comentario("Maria, voc� sabe qual curso ele faz ?", null, 892, "idNot", "comentId2");
    assertNull(coment2.getFile());
    assertNotNull(coment2.getTexto());
    assertEquals("Maria, voc� sabe qual curso ele faz ?", coment2.getTexto());
    assertEquals(892, coment1.getIdUsuario());
    assertEquals("idNot", coment1.getIdNotificao());
    assertEquals("comentId2", coment2.getId());
  }