Skip to content

Commit ad88b20

Browse files
committed
Agregar test unitario de y_respuesta
1 parent 6f4da2a commit ad88b20

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

test/database/install.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ prompt Creando tests de types...
5050
prompt -----------------------------------
5151
prompt
5252
@@types/test_y_dato.pck
53+
@@types/test_y_respuesta.pck
5354

5455
prompt
5556
prompt Creando tests de paquetes...
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
CREATE OR REPLACE PACKAGE test_y_respuesta IS
2+
3+
--%suite(Tests unitarios del type y_respuesta)
4+
--%tags(type)
5+
6+
--%test()
7+
PROCEDURE parse_json_generico;
8+
9+
END;
10+
/
11+
CREATE OR REPLACE PACKAGE BODY test_y_respuesta IS
12+
13+
PROCEDURE parse_json_generico IS
14+
l_respuesta y_respuesta;
15+
l_error y_error;
16+
l_resultado y_objeto;
17+
BEGIN
18+
-- Arrange
19+
l_respuesta := NEW y_respuesta();
20+
l_error := NEW y_error();
21+
l_error.id_error := '0001';
22+
l_error.mensaje := 'Este es un mensaje';
23+
l_respuesta.datos := l_error;
24+
--
25+
k_sistema.p_inicializar_cola;
26+
k_sistema.p_encolar('Y_ERROR');
27+
-- Act
28+
l_resultado := y_respuesta.parse_json(l_respuesta.to_json);
29+
-- Assert
30+
ut.expect(l_resultado.to_json).to_equal(l_respuesta.to_json);
31+
END;
32+
33+
END;
34+
/

test/database/uninstall.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ prompt Borrando tests de types...
7878
prompt -----------------------------------
7979
prompt
8080
drop package test_y_dato;
81+
drop package test_y_respuesta;
8182

8283
prompt
8384
prompt Vaciando papelera de reciclaje...

0 commit comments

Comments
 (0)