-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest-Runner.sql
More file actions
105 lines (92 loc) · 2.85 KB
/
Copy pathTest-Runner.sql
File metadata and controls
105 lines (92 loc) · 2.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
create or replace package simple_test_runner authid definer
as
procedure wtplsql_run;
end simple_test_runner;
/
create or replace package body simple_test_runner
as
procedure wtplsql_run is begin
wt_assert.eq(msg_in => 'Ad-Hoc Test'
,check_this_in => 1
,against_this_in => '1');
end wtplsql_run;
end simple_test_runner;
/
begin
wtplsql.test_run('SIMPLE_TEST_RUNNER');
end;
/
set serveroutput on size unlimited format word_wrapped
begin
wt_text_report.dbms_out(USER,'SIMPLE_TEST_RUNNER');
end;
/
set serveroutput on size unlimited format word_wrapped
begin
wt_text_report.dbms_out(in_runner_name => 'SIMPLE_TEST_RUNNER'
,in_detail_level => 30);
end;
/
create or replace package body simple_test_runner
as
procedure wtplsql_run is begin
wt_assert.g_testcase := 'My Test Case A';
wt_assert.eq(msg_in => 'Ad-Hoc Test1'
,check_this_in => 1
,against_this_in => '1');
wt_assert.eq(msg_in => 'Ad-Hoc Test2'
,check_this_in => 2
,against_this_in => '2');
wt_assert.g_testcase := 'My Test Case B';
wt_assert.eq(msg_in => 'Ad-Hoc Test1'
,check_this_in => 4
,against_this_in => ' 4');
wt_assert.eq(msg_in => 'Ad-Hoc Test2'
,check_this_in => 5
,against_this_in => to_number(' 5'));
end wtplsql_run;
end simple_test_runner;
/
begin
wtplsql.test_run('SIMPLE_TEST_RUNNER');
wt_text_report.dbms_out(in_runner_name => 'SIMPLE_TEST_RUNNER'
,in_detail_level => 30);
end;
/
create or replace package body simple_test_runner
as
--% WTPLSQL SET DBOUT "SIMPLE_TEST_RUNNER:PACKAGE BODY" %--
procedure wtplsql_run is begin
wt_assert.eq(msg_in => 'Ad-Hoc Test'
,check_this_in => 1
,against_this_in => '1');
end wtplsql_run;
end simple_test_runner;
/
begin
wtplsql.test_run('SIMPLE_TEST_RUNNER');
wt_text_report.dbms_out(USER,'SIMPLE_TEST_RUNNER');
end;
/
create or replace package body simple_test_runner
as
--% WTPLSQL SET DBOUT "SIMPLE_TEST_RUNNER:PACKAGE BODY" %--
function add2 (in_val1 number, in_val2 number) return number is
l_result number;
begin
l_result := in_val1 + in_val2;
return l_result;
end add2;
procedure wtplsql_run is begin --%WTPLSQL_begin_ignore_lines%--
wt_assert.g_testcase := 'My Test Case';
wt_assert.eq(msg_in => 'Ad-Hoc Test'
,check_this_in => add2(2, 3)
,against_this_in => 5);
end wtplsql_run; --%WTPLSQL_end_ignore_lines%--
end simple_test_runner;
/
begin
wtplsql.test_run('SIMPLE_TEST_RUNNER');
wt_text_report.dbms_out(USER,'SIMPLE_TEST_RUNNER',30);
end;
/