Skip to content
Snippets Groups Projects
Commit 8e55b306 authored by JotaJota96's avatar JotaJota96
Browse files

Se borraron testeos de otras clases que no venian al caso en esta rama

parent 5d2cc070
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 3307 deletions
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Clases;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class AdministradorTest {
public AdministradorTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getNuevoID method, of class Administrador.
*/
@Test
public void testGetNuevoID() {
System.out.println("getNuevoID");
int expResult = 1;
int result = Administrador.getNuevoID();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getIdAdmin method, of class Administrador.
*/
@Test
public void testGetIdAdmin() {
System.out.println("getIdAdmin");
Administrador instance = new Administrador(0, "contrasenia", "nombre", "apellido");
int expResult = 0;
int result = instance.getIdAdmin();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Clases;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class CategoriaTest {
public CategoriaTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of constructor method, of class Categoria.
*/
@Test
public void testCategoria_vacia() {
System.out.println("testCategoria_vacia");
Categoria result = null;
try {
result = new Categoria("");
} catch (Exception e) {
assertNull(result);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNombre method, of class Categoria.
*/
@Test
public void testGetNombre() {
System.out.println("getNombre");
Categoria instance = new Categoria("Cat test");
String expResult = "Cat test";
String result = instance.getNombre();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Clases;
import Logica.DataType.DtCanal;
import Logica.DataType.DtComentario;
import Logica.Enumerados.Privacidad;
import java.sql.Date;
import java.util.ArrayList;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Carlos BM
*/
public class ComentarioTest {
Usuario user;
Comentario com;
Date fecha;
public ComentarioTest() {
fecha = new Date(190,7,4);
user = new Usuario("MCbolso", "mcbolso@gmail.com",fecha, "imagen.jpg", "dsfsdf", "mariano", "Castro", new DtCanal(0, "mi_canal", "un_canal_mas", Privacidad.PRIVADO));
com = new Comentario(0, fecha, "una cagada", 0, user);
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getNuevoID method, of class Comentario.
*/
@Test
public void testGetNuevoID() {
System.out.println("getNuevoID");
Comentario instance = com;
int expResult = 1;
int result = instance.getNuevoID();
assertEquals(expResult, result);
}
/**
* Test of getId method, of class Comentario.
*/
@Test
public void testGetId() {
System.out.println("getId");
Comentario instance = com;
int expResult = 0;
int result = instance.getId();
assertEquals(expResult, result);
}
/**
* Test of getFecha method, of class Comentario.
*/
@Test
public void testGetFecha() {
System.out.println("getFecha");
Comentario instance = com;
Date expResult = fecha;
Date result = instance.getFecha();
assertEquals(expResult, result);
}
/**
* Test of getTexto method, of class Comentario.
*/
@Test
public void testGetTexto() {
System.out.println("getTexto");
Comentario instance = com;
String expResult = "una cagada";
String result = instance.getTexto();
assertEquals(expResult, result);
}
/**
* Test of getNivelSubComentario method, of class Comentario.
*/
@Test
public void testGetNivelSubComentario() {
System.out.println("getNivelSubComentario");
Comentario instance = com;
int expResult = 0;
int result = instance.getNivelSubComentario();
assertEquals(expResult, result);
}
/**
* Test of getUsr method, of class Comentario.
*/
@Test
public void testGetUsr() {
System.out.println("getUsr");
Comentario instance = com;
Usuario expResult = user;
Usuario result = instance.getUsr();
assertEquals(expResult, result);
}
/**
* Test of toString method, of class Comentario.
*/
@Test
public void testToString() {
System.out.println("toString");
Comentario instance = com;
String expResult = "Comentario{id=0, fecha=2090-08-04, texto=una cagada, nivelSubComentario=0}";
String result = instance.toString();
assertEquals(expResult, result);
}
@Test
public void testComentario_basuraFecha() {
System.out.println("comentario");
try {
Comentario comy = new Comentario(0, null, "una cagada", 0, user);
} catch (Exception e) {
assertEquals(true, true);
}
}
@Test
public void testComentario_basura_usuario() {
System.out.println("comentario");
try {
Comentario comy = new Comentario(5, fecha, "una cagada", 0, null);
} catch (Exception e) {
assertEquals(true, true);
}
}
/**
* Test of agregarSubComentario method, of class Comentario.
*/
@Test
public void testAgregarSubComentario() {
System.out.println("agregarSubComentario");
int idComPadre = 0;
DtComentario dtC = new DtComentario(1, "otroNickname", fecha, "otra cagada", 1);
Usuario usr = user;
Comentario instance = com;
boolean expResult = true;
boolean result = instance.agregarSubComentario(idComPadre, dtC, usr);
assertEquals(expResult, result);
}
@Test
public void testAgregarSubComentarioNoagrega() {
System.out.println("agregarSubComentario");
com.agregarSubComentario(1, new DtComentario(1, "otroNickname", fecha, "otra cagada", 1), user);
int idComPadre = 1;
DtComentario dtC = new DtComentario(2, "otroNickname", fecha, "otra cagada", 1);
Usuario usr = user;
Comentario instance = com;
boolean expResult = false;
boolean result = instance.agregarSubComentario(idComPadre, dtC, usr);
assertEquals(expResult, result);
}
@Test
public void testAgregarSubComentarioNoagrega_basura_1() {
System.out.println("agregarSubComentario");
int idComPadre = 1;
Usuario usr = user;
Comentario instance = com;
boolean expResult = false;
boolean result =false;
try{
result = instance.agregarSubComentario(idComPadre, null, usr);
}catch(Exception e){
assertEquals(true, true);
}
}
@Test
public void testAgregarSubComentarioNoagrega_basura_2() {
System.out.println("agregarSubComentario");
int idComPadre = 1;
DtComentario dtC = new DtComentario(2, "otroNickname", fecha, "otra cagada", 1);
Comentario instance = com;
boolean expResult = false;
boolean result = false;
try{
result = instance.agregarSubComentario(idComPadre, dtC, null);
}catch(Exception e){
assertEquals(true, true);
}
}
/**
* Test of getDT method, of class Comentario.
*/
@Test
public void testGetDT() {
System.out.println("getDT");
Comentario instance = com;
DtComentario expResult = new DtComentario(0, "MCbolso", fecha, "una cagada", 0);
DtComentario result = instance.getDT();
assertEquals(expResult.toString(), result.toString());
}
/**
* Test of listarSubComentarios method, of class Comentario.
*/
@Test
public void testListarSubComentarios() {
System.out.println("listarSubComentarios");
Comentario instance = com;
com.agregarSubComentario(0, new DtComentario(1, "otroNickname", fecha, "otra cagada", 1), user);
com.agregarSubComentario(0, new DtComentario(1, "otroNickname2", fecha, "otra cagada", 1), user);
com.agregarSubComentario(0, new DtComentario(1, "otroNickname3", fecha, "otra cagada", 1), user);
com.agregarSubComentario(2, new DtComentario(1, "otroNickname4", fecha, "otra cagada", 1), user);
com.agregarSubComentario(4, new DtComentario(1, "otroNickname5", fecha, "otra cagada", 1), user);
com.agregarSubComentario(3, new DtComentario(1, "otroNickname6", fecha, "otra cagada", 1), user);
ArrayList<DtComentario> expResult = new ArrayList();
ArrayList<DtComentario> result = instance.listarSubComentarios();
assertEquals(6, result.size());
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Clases;
import Logica.DataType.DtListaDeReproduccion;
import Logica.DataType.DtVideo;
import Logica.Enumerados.Privacidad;
import Logica.Enumerados.TipoListaDeReproduccion;
import java.sql.Date;
import java.sql.Time;
import java.util.ArrayList;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class ListaDeReproduccionTest {
private ListaDeReproduccion ldrParticular = null;
private ListaDeReproduccion ldrPorDefecto = null;
Video v = null;
public ListaDeReproduccionTest() {
ldrParticular = new ListaDeReproduccion(0, "mi lista", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
ldrPorDefecto = new ListaDeReproduccion(0, "mi lista", Privacidad.PRIVADO, TipoListaDeReproduccion.POR_DEFECTO, "UNDEFINED");
v = new Video(0, "_nombre", "_descripcion", new Time(0, 10, 15), new Date(2019-1900, 5, 15), "_urlVideoOriginal", "UNDEFINED");
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getNuevoId method, of class ListaDeReproduccion.
*/
@Test
public void testGetNuevoId() {
System.out.println("getNuevoId");
int expResult = 1;
int result = ListaDeReproduccion.getNuevoId();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testGetNuevoId2() {
System.out.println("getNuevoId2");
int expResult = 2;
int result = ListaDeReproduccion.getNuevoId();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of listarNombresDeListasPorDefecto method, of class ListaDeReproduccion.
*/
@Test
public void testListarNombresDeListasPorDefecto() {
System.out.println("listarNombresDeListasPorDefecto");
ArrayList<String> expResult = new ArrayList();
expResult.add("Ver mas tarde");
ArrayList<String> result = ListaDeReproduccion.listarNombresDeListasPorDefecto();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of agregarListaPorDefecto method, of class ListaDeReproduccion.
*/
@Test
public void testAgregarListaPorDefecto() {
System.out.println("agregarListaPorDefecto");
ArrayList<String> expResult = new ArrayList();
expResult.add("Ver mas tarde");
expResult.add("Favoritos");
ListaDeReproduccion.agregarListaPorDefecto("Favoritos");
ArrayList<String> result = ListaDeReproduccion.listarNombresDeListasPorDefecto();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testAgregarListaPorDefecto2() {
System.out.println("agregarListaPorDefecto2");
ArrayList<String> expResult = new ArrayList();
ArrayList<String> result = null;
expResult.add("Ver mas tarde");
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
try {
ListaDeReproduccion.agregarListaPorDefecto("");
assertEquals(expResult, result);
} catch (Exception e) {
result = ListaDeReproduccion.listarNombresDeListasPorDefecto();
assertEquals(expResult, result);
}
}
/**
* Test of getId method, of class ListaDeReproduccion.
*/
@Test
public void testGetId() {
System.out.println("testGetId");
ListaDeReproduccion instance = ldrParticular;
int expResult = 0;
int result = instance.getId();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNombre method, of class ListaDeReproduccion.
*/
@Test
public void testGetNombre() {
System.out.println("getNombre");
ListaDeReproduccion instance = ldrParticular;
String expResult = "mi lista";
String result = instance.getNombre();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getPrivacidad method, of class ListaDeReproduccion.
*/
@Test
public void testGetPrivacidad() {
System.out.println("getPrivacidad");
ListaDeReproduccion instance = ldrParticular;
Privacidad expResult = Privacidad.PRIVADO;
Privacidad result = instance.getPrivacidad();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of setPrivacidad method, of class ListaDeReproduccion.
*/
@Test
public void testSetPrivacidad() {
System.out.println("setPrivacidad");
ListaDeReproduccion instance = ldrParticular;
instance.setPrivacidad(Privacidad.PUBLICO);
assertEquals(Privacidad.PUBLICO, ldrParticular.getPrivacidad());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
instance.setPrivacidad(Privacidad.PRIVADO);
}
/**
* Test of getTipo method, of class ListaDeReproduccion.
*/
@Test
public void testGetTipo() {
System.out.println("getTipo");
ListaDeReproduccion instance = ldrParticular;
TipoListaDeReproduccion expResult = TipoListaDeReproduccion.PARTICULAR;
TipoListaDeReproduccion result = instance.getTipo();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of toString method, of class ListaDeReproduccion.
*/
@Test
public void testToString() {
System.out.println("toString");
ListaDeReproduccion instance = ldrParticular;
String expResult = "ListaDeReproduccion{id=0, nombre=mi lista, privacidad=PRIVADO, tipo=PARTICULAR, categoria=UNDEFINED, misVideos.size=0}";
String result = instance.toString();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getCategoria method, of class ListaDeReproduccion.
*/
@Test
public void testGetCategoria() {
System.out.println("getCategoria");
ListaDeReproduccion instance = ldrParticular;
String expResult = "UNDEFINED";
String result = instance.getCategoria();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getDt method, of class ListaDeReproduccion.
*/
@Test
public void testGetDt() {
System.out.println("getDt");
ListaDeReproduccion instance = null;
DtListaDeReproduccion expResult = new DtListaDeReproduccion(0, "mi lista", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
DtListaDeReproduccion result = ldrParticular.getDt();
assertEquals(expResult.toString(), result.toString());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
///////////////////////////////////////////////////////////////////////////////////////////////////
/**
* Test of agregarVideoA method, of class ListaDeReproduccion.
*/
@Test
public void testAgregarVideoA_null() {
System.out.println("agregarVideoA");
ListaDeReproduccion instance = ldrParticular;
int expResult = instance.listarVideos().size();
try {
instance.agregarVideoA(null);
} catch (Exception e) {
assertEquals(expResult, instance.listarVideos().size());
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of agregarVideoA method, of class ListaDeReproduccion.
*/
@Test
public void testAgregarVideoA() {
System.out.println("agregarVideoA");
int expResult = ldrParticular.listarVideos().size() +1;
ListaDeReproduccion instance = ldrParticular;
instance.agregarVideoA(v);
assertEquals(expResult, ldrParticular.listarVideos().size());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of constructor method, of class ListaDeReproduccion.
*/
@Test
public void testListaDeReproduccion_1() {
System.out.println("agregarVideoA");
try {
ListaDeReproduccion instance = new ListaDeReproduccion(0, "", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
} catch (Exception e) {
assertEquals(true, true);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testListaDeReproduccion_2() {
System.out.println("agregarVideoA");
try {
ListaDeReproduccion instance = new ListaDeReproduccion(0, "mi lista", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "");
} catch (Exception e) {
assertEquals(true, true);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testListaDeReproduccion_3() {
System.out.println("agregarVideoA");
try {
ListaDeReproduccion instance = new ListaDeReproduccion(0, "mi lista", Privacidad.PUBLICO, TipoListaDeReproduccion.POR_DEFECTO, "UNDEFINED");
} catch (Exception e) {
assertEquals(true, true);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testListaDeReproduccion_4() {
System.out.println("agregarVideoA");
try {
ListaDeReproduccion instance = new ListaDeReproduccion(0, "mi lista", Privacidad.PRIVADO, TipoListaDeReproduccion.POR_DEFECTO, "MUSICA");
} catch (Exception e) {
assertEquals(true, true);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of listarVideos method, of class ListaDeReproduccion.
*/
@Test
public void testListarVideos() {
System.out.println("listarVideos");
ListaDeReproduccion instance = new ListaDeReproduccion(0, "mi lista", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");;
instance.agregarVideoA(v);
ArrayList<DtVideo> expResult = new ArrayList();
expResult.add(v.getDt());
ArrayList<DtVideo> result = instance.listarVideos();
assertEquals(expResult.size(), result.size());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of modificar method, of class ListaDeReproduccion.
*/
@Test
public void testModificar() {
System.out.println("modificar");
DtListaDeReproduccion ldr = new DtListaDeReproduccion(0, "mi musica", Privacidad.PUBLICO, TipoListaDeReproduccion.PARTICULAR, "MUSICA");
ListaDeReproduccion instance = ldrParticular;
instance.modificar(ldr);
assertEquals(ldr.toString(), instance.getDt().toString());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testModificar_exp_1() {
System.out.println("testModificar_exp_1");
ListaDeReproduccion instance = ldrPorDefecto;
DtListaDeReproduccion esperado = instance.getDt();
try {
DtListaDeReproduccion ldr = new DtListaDeReproduccion(0, "mi musica", Privacidad.PUBLICO, TipoListaDeReproduccion.PARTICULAR, "MUSICA");
instance.modificar(ldr);
} catch (Exception e) {
assertEquals(esperado.toString(), instance.getDt().toString());
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testModificar_exp_2() {
System.out.println("testModificar_exp_1");
ListaDeReproduccion instance = ldrParticular;
DtListaDeReproduccion esperado = instance.getDt();
try {
instance.modificar(null);
} catch (Exception e) {
assertEquals(esperado.toString(), instance.getDt().toString());
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testModificar_exp_3() {
System.out.println("testModificar_exp_1");
ListaDeReproduccion instance = ldrParticular;
DtListaDeReproduccion esperado = instance.getDt();
try {
DtListaDeReproduccion ldr = new DtListaDeReproduccion(0, "", Privacidad.PUBLICO, TipoListaDeReproduccion.PARTICULAR, "MUSICA");
instance.modificar(ldr);
} catch (Exception e) {
assertEquals(esperado.toString(), instance.getDt().toString());
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of quitarVideo method, of class ListaDeReproduccion.
*/
@Test
public void testQuitarVideo() {
System.out.println("quitarVideo");
ListaDeReproduccion instance = new ListaDeReproduccion(0, "mi lista", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");;
instance.agregarVideoA(v);
ArrayList<DtVideo> expResult = new ArrayList();
instance.quitarVideo(v.getId());
assertEquals(expResult.size(), instance.listarVideos().size());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Clases;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class PersonaTest {
public PersonaTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of constructor method, of class Persona.
*/
@Test
public void testPersona() {
System.out.println("getNombre");
Administrador instance = null;
try {
instance = new Administrador(0, "", "nombre", "apellido");
} catch (Exception e) {
assertNull(instance);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNombre method, of class Persona.
*/
@Test
public void testGetNombre() {
System.out.println("getNombre");
Administrador instance = new Administrador(0, "contrasenia", "nombre", "apellido");
String expResult = "nombre";
String result = instance.getNombre();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getApellido method, of class Persona.
*/
@Test
public void testGetApellido() {
System.out.println("getApellido");
Administrador instance = new Administrador(0, "contrasenia", "nombre", "apellido");
String expResult = "apellido";
String result = instance.getApellido();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of validarContrasenia method, of class Persona.
*/
@Test
public void testValidarContrasenia_correcta() {
System.out.println("testValidarContrasenia_correcta");
String pass = "contrasenia";
Administrador instance = new Administrador(0, "contrasenia", "nombre", "apellido");
boolean expResult = true;
boolean result = instance.validarContrasenia(pass);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of validarContrasenia method, of class Persona.
*/
@Test
public void testValidarContrasenia_incorrecta() {
System.out.println("testValidarContrasenia_correcta");
String pass = "contrasenia mala";
Administrador instance = new Administrador(0, "contrasenia", "nombre", "apellido");
boolean expResult = false;
boolean result = instance.validarContrasenia(pass);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
This diff is collapsed.
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Clases;
import Logica.DataType.DtValoracion;
import Logica.Enumerados.TipoValoracion;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
import Logica.Clases.Usuario;
import Logica.DataType.DtCanal;
import Logica.Enumerados.Privacidad;
import java.sql.Date;
/**
*
* @author Carlos BM
*/
public class ValoracionTest {
Usuario user;
Valoracion valo;
public ValoracionTest() {
user = new Usuario("MCbolso", "mcbolso@gmail.com", new Date(190,7,4), "imagen.jpg", "dsfsdf", "mariano", "Castro", new DtCanal(0, "mi_canal", "un_canal_mas", Privacidad.PRIVADO));
valo = new Valoracion(TipoValoracion.LIKE, user);
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getVal method, of class Valoracion.
*/
@Test
public void testValoracion() {
System.out.println("getVal");
Valoracion instance;
try{
instance = new Valoracion(TipoValoracion.LIKE, null);
}catch(Exception e){
assertEquals(true, true);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testGetVal() {
System.out.println("getVal");
Valoracion instance = valo;
TipoValoracion expResult = TipoValoracion.LIKE;
TipoValoracion result = instance.getVal();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of setVal method, of class Valoracion.
*/
@Test
public void testSetVal() {
System.out.println("setVal");
TipoValoracion val = null;
Valoracion instance = valo;
instance.setVal(val);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNicknameDeUsuario method, of class Valoracion.
*/
@Test
public void testGetNicknameDeUsuario() {
System.out.println("getNicknameDeUsuario");
Valoracion instance = valo;
String expResult = "MCbolso";
String result = instance.getNicknameDeUsuario();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getDT method, of class Valoracion.
*/
@Test
public void testGetDT_0args() {
System.out.println("getDT");
Valoracion instance = valo;
DtValoracion expResult = new DtValoracion(TipoValoracion.LIKE, "MCbolso");
DtValoracion result = instance.getDT();
assertEquals(expResult.toString(), result.toString());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getDT method, of class Valoracion.
*/
@Test
public void testGetDT_String() {
System.out.println("getDT");
String nickname = "MCbolso";
Valoracion instance = valo;
DtValoracion expResult = new DtValoracion(TipoValoracion.LIKE, "MCbolso");
DtValoracion result = instance.getDT(nickname);
assertEquals(expResult.toString(), result.toString());
}
@Test
public void testGetDT_String_mal() {
System.out.println("getDT");
Valoracion instance = valo;
//DtValoracion result = instance.getDT("Lucas");
assertNull(instance.getDT("Lucas"));
}
@Test
public void testGetDT_String_null_basura() {
System.out.println("getDT");
String nickname = null;
Valoracion instance = valo;
try {
instance.getDT(nickname);
} catch (Exception e) {
assertEquals(true, true);
}
}
/**
* Test of modificar method, of class Valoracion.
*/
@Test
public void testModificar() {
System.out.println("modificar");
DtValoracion dtV = new DtValoracion(TipoValoracion.DISLIKE, "MCbolso");
String nickname = "MCbolso";
Valoracion instance = valo;
boolean expResult = true;
boolean result = instance.modificar(dtV, nickname);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testModificar_false() {
System.out.println("modificar");
DtValoracion dtV = new DtValoracion(TipoValoracion.DISLIKE, "MCbolso");
String nickname = "Lucas";
Valoracion instance = valo;
boolean expResult = false;
boolean result = instance.modificar(dtV, nickname);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testModificar_null_1() {
System.out.println("modificar");
DtValoracion dtV = new DtValoracion(TipoValoracion.DISLIKE, "MCbolso");
String nickname = null;
Valoracion instance = valo;
boolean expResult = false;
boolean result = false;
try{
result = instance.modificar(dtV, nickname);
}catch(Exception e){
assertEquals(expResult, result);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
@Test
public void testModificar_null_2() {
System.out.println("modificar");
DtValoracion dtV = null;
String nickname = "MCbolso";
Valoracion instance = valo;
boolean expResult = false;
boolean result = false;
try{
result = instance.modificar(dtV, nickname);
}catch(Exception e){
assertEquals(expResult, result);
}
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.DataType;
import Logica.Enumerados.Privacidad;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class DtCanalTest {
DtCanal instance = null;
public DtCanalTest() {
instance = new DtCanal(0, "nombre", "descripcion", Privacidad.PRIVADO);
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getId method, of class DtCanal.
*/
@Test
public void testGetId() {
System.out.println("getId");
int expResult = 0;
int result = instance.getId();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNombre method, of class DtCanal.
*/
@Test
public void testGetNombre() {
System.out.println("getNombre");
String expResult = "nombre";
String result = instance.getNombre();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getDescripcion method, of class DtCanal.
*/
@Test
public void testGetDescripcion() {
System.out.println("getDescripcion");
String expResult = "descripcion";
String result = instance.getDescripcion();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getPrivacidad method, of class DtCanal.
*/
@Test
public void testGetPrivacidad() {
System.out.println("getPrivacidad");
Privacidad expResult = Privacidad.PRIVADO;
Privacidad result = instance.getPrivacidad();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of toString method, of class DtCanal.
*/
@Test
public void testToString() {
System.out.println("toString");
String expResult = "DtCanal{id=0, nombre=nombre, descripcion=descripcion, privacidad=PRIVADO}";
String result = instance.toString();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.DataType;
import Logica.Clases.Categoria;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class DtCategoriaTest {
public DtCategoriaTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getNombre method, of class DtCategoria.
*/
@Test
public void testGetNombre() {
System.out.println("getNombre");
DtCategoria instance = new DtCategoria("MUSICA");
String expResult = "MUSICA";
String result = instance.getNombre();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of toString method, of class DtCategoria.
*/
@Test
public void testToString() {
System.out.println("toString");
DtCategoria instance = new DtCategoria("MUSICA");
String expResult = "DtCategoria{nombre=MUSICA}";
String result = instance.toString();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.DataType;
import java.sql.Date;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class DtComentarioTest {
public DtComentarioTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getId method, of class DtComentario.
*/
@Test
public void testGetId() {
System.out.println("getId");
DtComentario instance = new DtComentario(0, "nickname", new Date(2019-1900, 1, 1), "texto", 1);
int expResult = 0;
int result = instance.getId();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNickname method, of class DtComentario.
*/
@Test
public void testGetNickname() {
System.out.println("getNickname");
DtComentario instance = new DtComentario(0, "nickname", new Date(2019-1900, 1, 1), "texto", 1);
String expResult = "nickname";
String result = instance.getNickname();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getFecha method, of class DtComentario.
*/
@Test
public void testGetFecha() {
System.out.println("getFecha");
DtComentario instance = new DtComentario(0, "nickname", new Date(2019-1900, 1, 1), "texto", 1);
Date expResult = new Date(2019-1900, 1, 1);
Date result = instance.getFecha();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getTexto method, of class DtComentario.
*/
@Test
public void testGetTexto() {
System.out.println("getTexto");
DtComentario instance = new DtComentario(0, "nickname", new Date(2019-1900, 1, 1), "texto", 1);
String expResult = "texto";
String result = instance.getTexto();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNivelSubComentario method, of class DtComentario.
*/
@Test
public void testGetNivelSubComentario() {
System.out.println("getNivelSubComentario");
DtComentario instance = new DtComentario(0, "nickname", new Date(2019-1900, 1, 1), "texto", 1);
int expResult = 1;
int result = instance.getNivelSubComentario();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of toString method, of class DtComentario.
*/
@Test
public void testToString() {
System.out.println("toString");
DtComentario instance = new DtComentario(0, "nickname", new Date(2019-1900, 1, 1), "texto", 1);
String expResult = "DtComentario{id=0, nickname=nickname, fecha=2019-02-01, texto=texto, nivelSubComentario=1}";
String result = instance.toString();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.DataType;
import Logica.Clases.ListaDeReproduccion;
import Logica.Enumerados.Privacidad;
import Logica.Enumerados.TipoListaDeReproduccion;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class DtListaDeReproduccionTest {
public DtListaDeReproduccionTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getId method, of class DtListaDeReproduccion.
*/
@Test
public void testGetId() {
System.out.println("getId");
DtListaDeReproduccion instance = new DtListaDeReproduccion(0, "nombre", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
int expResult = 0;
int result = instance.getId();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getNombre method, of class DtListaDeReproduccion.
*/
@Test
public void testGetNombre() {
System.out.println("getNombre");
DtListaDeReproduccion instance = new DtListaDeReproduccion(0, "nombre", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
String expResult = "nombre";
String result = instance.getNombre();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getPrivacidad method, of class DtListaDeReproduccion.
*/
@Test
public void testGetPrivacidad() {
System.out.println("getPrivacidad");
DtListaDeReproduccion instance = new DtListaDeReproduccion(0, "nombre", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
Privacidad expResult = Privacidad.PRIVADO;
Privacidad result = instance.getPrivacidad();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getTipo method, of class DtListaDeReproduccion.
*/
@Test
public void testGetTipo() {
System.out.println("getTipo");
DtListaDeReproduccion instance = new DtListaDeReproduccion(0, "nombre", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
TipoListaDeReproduccion expResult = TipoListaDeReproduccion.PARTICULAR;
TipoListaDeReproduccion result = instance.getTipo();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getCategoria method, of class DtListaDeReproduccion.
*/
@Test
public void testGetCategoria() {
System.out.println("getCategoria");
DtListaDeReproduccion instance = new DtListaDeReproduccion(0, "nombre", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
String expResult = "UNDEFINED";
String result = instance.getCategoria();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of toString method, of class DtListaDeReproduccion.
*/
@Test
public void testToString() {
System.out.println("toString");
DtListaDeReproduccion instance = new DtListaDeReproduccion(0, "nombre", Privacidad.PRIVADO, TipoListaDeReproduccion.PARTICULAR, "UNDEFINED");
String expResult = "DtListaDeReproduccion{id=0, nombre=nombre, privacidad=PRIVADO, tipo=PARTICULAR, categoria=UNDEFINED}";
String result = instance.toString();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.DataType;
import java.sql.Date;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class DtPersonaTest {
public DtPersonaTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getNombre method, of class DtPersona.
*/
@Test
public void testGetNombre() {
System.out.println("getNickname");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
String expResult = "nombre";
String result = instance.getNombre();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getApellido method, of class DtPersona.
*/
@Test
public void testGetApellido() {
System.out.println("getNickname");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
String expResult = "apellido";
String result = instance.getApellido();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getContrasenia method, of class DtPersona.
*/
@Test
public void testGetContrasenia() {
System.out.println("getNickname");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
String expResult = "contrasenia";
String result = instance.getContrasenia();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.DataType;
import java.sql.Date;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class DtUsuarioTest {
public DtUsuarioTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getNickname method, of class DtUsuario.
*/
@Test
public void testGetNickname() {
System.out.println("getNickname");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
String expResult = "nickname";
String result = instance.getNickname();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getCorreo method, of class DtUsuario.
*/
@Test
public void testGetCorreo() {
System.out.println("getCorreo");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
String expResult = "correo";
String result = instance.getCorreo();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getFechaNacimiento method, of class DtUsuario.
*/
@Test
public void testGetFechaNacimiento() {
System.out.println("getFechaNacimiento");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
Date expResult = new Date(2019-1900, 1, 1);
Date result = instance.getFechaNacimiento();
assertEquals(expResult.toString(), result.toString());
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getImagen method, of class DtUsuario.
*/
@Test
public void testGetImagen() {
System.out.println("getImagen");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
String expResult = "imagen";
String result = instance.getImagen();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getCantSeguidores method, of class DtUsuario.
*/
@Test
public void testGetCantSeguidores() {
System.out.println("getCantSeguidores");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
int expResult = 0;
int result = instance.getCantSeguidores();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of toString method, of class DtUsuario.
*/
@Test
public void testToString() {
System.out.println("toString");
DtUsuario instance = new DtUsuario(
"nickname",
"contrasenia",
"nombre",
"apellido",
"correo",
new Date(2019-1900, 1, 1),
"imagen",
0);
String expResult = "DtUsuario{DtPersona{nombre=nombre, apellido=apellido, contrasenia=contrasenia}, nickname=nickname, correo=correo, fechaNacimiento=2019-02-01, imagen=imagen, cantSeguidores=0}";
String result = instance.toString();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.DataType;
import Logica.Enumerados.TipoValoracion;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class DtValoracionTest {
public DtValoracionTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of getNickname method, of class DtValoracion.
*/
@Test
public void testGetNickname() {
System.out.println("getNickname");
DtValoracion instance = new DtValoracion(TipoValoracion.LIKE, "nickname");
String expResult = "nickname";
String result = instance.getNickname();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of getVal method, of class DtValoracion.
*/
@Test
public void testGetVal() {
System.out.println("getVal");
DtValoracion instance = new DtValoracion(TipoValoracion.LIKE, "nickname");
TipoValoracion expResult = TipoValoracion.LIKE;
TipoValoracion result = instance.getVal();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of toString method, of class DtValoracion.
*/
@Test
public void testToString() {
System.out.println("toString");
DtValoracion instance = new DtValoracion(TipoValoracion.LIKE, "nickname");
String expResult = "DtValoracion{val=LIKE, nickname=nickname}";
String result = instance.toString();
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
package Logica.DataType;
import Logica.Enumerados.Privacidad;
import java.sql.Date;
import java.sql.Time;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Carlos BM
*/
public class DtVideoTest {
DtVideo dtv;
public DtVideoTest() {
dtv = new DtVideo(2, "video1", "un_video", new Time(1,1,1), new Date(190,1,2), "https://sdsd.com", Privacidad.PRIVADO, "futbol", 0, 0);
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
@Test
public void testGetId() {
System.out.println("getId");
DtVideo instance = dtv;
int expResult = 2;
int result = instance.getId();
assertEquals(expResult, result);
}
@Test
public void testGetNombre() {
System.out.println("getNombre");
DtVideo instance = dtv;
String expResult = "video1";
String result = instance.getNombre();
assertEquals(expResult, result);
}
@Test
public void testGetDescripcion() {
System.out.println("getDescripcion");
DtVideo instance = dtv;
String expResult = "un_video";
String result = instance.getDescripcion();
assertEquals(expResult, result);
}
@Test
public void testGetDuracion() {
System.out.println("getDuracion");
DtVideo instance = dtv;
Time expResult = new Time(1,1,1);
Time result = instance.getDuracion();
assertEquals(expResult, result);
}
@Test
public void testGetFechaPublicacion() {
System.out.println("getFechaPublicacion");
DtVideo instance = dtv;
Date expResult = new Date(190,1,2);
Date result = instance.getFechaPublicacion();
assertEquals(expResult, result);
}
@Test
public void testGetUrlVideoOriginal() {
System.out.println("getUrlVideoOriginal");
DtVideo instance = dtv;
String expResult = "https://sdsd.com";
String result = instance.getUrlVideoOriginal();
assertEquals(expResult, result);
}
@Test
public void testGetPrivacidad() {
System.out.println("getPrivacidad");
DtVideo instance = dtv;
Privacidad expResult = Privacidad.PRIVADO;
Privacidad result = instance.getPrivacidad();
assertEquals(expResult, result);
}
@Test
public void testGetCategoria() {
System.out.println("getCategoria");
DtVideo instance = dtv;
String expResult = "futbol";
String result = instance.getCategoria();
assertEquals(expResult, result);
}
@Test
public void testGetCantLikes() {
System.out.println("getCantLikes");
DtVideo instance = dtv;
int expResult = 0;
int result = instance.getCantLikes();
assertEquals(expResult, result);
}
@Test
public void testGetCantDisLikes() {
System.out.println("getCantDisLikes");
DtVideo instance = dtv;
int expResult = 0;
int result = instance.getCantDisLikes();
assertEquals(expResult, result);
}
@Test
public void testToString() {
System.out.println("toString");
DtVideo instance = dtv;
String expResult = "DtVideo{id=2, nombre=video1, descripcion=un_video, duracion=01:01:01, fechaPublicacion=2090-02-02, urlVideoOriginal=https://sdsd.com, privacidad=PRIVADO, categoria=futbol, cantLikes=0, cantDisLikes=0}";
String result = instance.toString();
assertEquals(expResult, result);
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Enumerados;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class PrivacidadTest {
public PrivacidadTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of values method, of class Privacidad.
*/
@Test
public void testValues() {
System.out.println("values");
Privacidad[] expResult = {Privacidad.PUBLICO, Privacidad.PRIVADO};
Privacidad[] result = Privacidad.values();
assertArrayEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of valueOf method, of class Privacidad.
*/
@Test
public void testValueOf() {
System.out.println("valueOf");
String name = "PRIVADO";
Privacidad expResult = Privacidad.PRIVADO;
Privacidad result = Privacidad.valueOf(name);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Enumerados;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class TipoListaDeReproduccionTest {
public TipoListaDeReproduccionTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of values method, of class TipoListaDeReproduccion.
*/
@Test
public void testValues() {
System.out.println("values");
TipoListaDeReproduccion[] expResult = {TipoListaDeReproduccion.POR_DEFECTO, TipoListaDeReproduccion.PARTICULAR};
TipoListaDeReproduccion[] result = TipoListaDeReproduccion.values();
assertArrayEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of valueOf method, of class TipoListaDeReproduccion.
*/
@Test
public void testValueOf() {
System.out.println("valueOf");
String name = "POR_DEFECTO";
TipoListaDeReproduccion expResult = TipoListaDeReproduccion.POR_DEFECTO;
TipoListaDeReproduccion result = TipoListaDeReproduccion.valueOf(name);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package Logica.Enumerados;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import static org.junit.Assert.*;
/**
*
* @author Juan
*/
public class TipoValoracionTest {
public TipoValoracionTest() {
}
@BeforeClass
public static void setUpClass() {
}
@AfterClass
public static void tearDownClass() {
}
@Before
public void setUp() {
}
@After
public void tearDown() {
}
/**
* Test of values method, of class TipoValoracion.
*/
@Test
public void testValues() {
System.out.println("values");
TipoValoracion[] expResult = {TipoValoracion.LIKE, TipoValoracion.DISLIKE};
TipoValoracion[] result = TipoValoracion.values();
assertArrayEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
/**
* Test of valueOf method, of class TipoValoracion.
*/
@Test
public void testValueOf() {
System.out.println("valueOf");
String name = "LIKE";
TipoValoracion expResult = TipoValoracion.LIKE;
TipoValoracion result = TipoValoracion.valueOf(name);
assertEquals(expResult, result);
// TODO review the generated test code and remove the default call to fail.
//fail("The test case is a prototype.");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment