Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9855025

Browse files
pesseSamuel Nitsche
authored andcommitted
Test outcome of ut3.ut.expect - not the cursor
We want to test the behaviour of ut.expect instead of testing the actual cursor comparison. Also removed the package type for it's not necessary
1 parent abf600b commit 9855025

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

test/ut_expectations/test_expectations_cursor.pkb

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,26 @@ create or replace package body test_expectations_cursor is
2020
procedure test_cursor_w_temp_table
2121
as
2222
pragma autonomous_transaction;
23-
v_expected t_gtt_data_t;
24-
2523
c_expected sys_refcursor;
2624
c_actual sys_refcursor;
2725
begin
28-
29-
v_expected(1).value := 'Test-entry';
3026

31-
-- insert test-data into temporary table
27+
-- Arrange
3228
execute immediate 'insert into gtt_test_table ( value ) values ( ''Test-entry'' )';
3329

34-
-- test
35-
open c_expected for select * from table(v_expected);
30+
open c_expected for select 'Test-entry' as value from dual;
3631
open c_actual for 'select * from gtt_test_table';
37-
38-
ut.expect( c_actual ).to_equal( a_expected => c_expected );
39-
32+
33+
--Act - execute the expectation on cursor opened on GTT
34+
ut3.ut.expect( c_actual ).to_equal( a_expected => c_expected );
35+
36+
--Assert - check that expectation was executed successfully
37+
ut.expect(ut3.ut_expectation_processor.get_status()).to_equal(ut3.ut_utils.tr_success);
38+
39+
--Cleanup
40+
ut3.ut_expectation_processor.clear_expectations();
41+
42+
rollback;
4043
end;
4144
end;
4245
/

test/ut_expectations/test_expectations_cursor.pks

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,5 @@ create or replace package test_expectations_cursor is
1111
--%beforetest(setup_temp_table_test)
1212
--%aftertest(cleanup_temp_table_test)
1313
procedure test_cursor_w_temp_table;
14-
15-
type t_gtt_data_r is record (
16-
value varchar2(250)
17-
);
18-
type t_gtt_data_t is table of t_gtt_data_r index by binary_integer;
1914
end;
2015
/

0 commit comments

Comments
 (0)