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

Skip to content

Commit 2e721da

Browse files
committed
CHECKPOINT
1 parent 013db74 commit 2e721da

8 files changed

Lines changed: 65 additions & 18 deletions

File tree

source/expectations/matchers/ut_be_within.tpb

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,22 @@ create or replace type body ut_be_within as
4545
l_result ut_be_within := self;
4646
begin
4747
l_result.expected := ut_data_value_number(a_expected);
48-
l_result.expectation.to_(l_result );
48+
if l_result.is_negated_flag = 1 then
49+
l_result.expectation.not_to(l_result );
50+
else
51+
l_result.expectation.to_(l_result );
52+
end if;
4953
end;
5054

5155
member procedure of_(self in ut_be_within, a_expected date) is
5256
l_result ut_be_within := self;
5357
begin
5458
l_result.expected := ut_data_value_date(a_expected);
55-
l_result.expectation.to_(l_result );
59+
if l_result.is_negated_flag = 1 then
60+
l_result.expectation.not_to(l_result );
61+
else
62+
l_result.expectation.to_(l_result );
63+
end if;
5664
end;
5765

5866
overriding member function run_matcher(self in out nocopy ut_be_within, a_actual ut_data_value) return boolean is

source/expectations/ut_expectation.tpb

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,39 @@ create or replace type body ut_expectation as
725725
l_result.expectation := self;
726726
return treat(l_result as ut_be_within);
727727
end;
728+
729+
member function not_to_be_within(a_dist natural) return ut_be_within is
730+
l_result ut_matcher;
731+
begin
732+
l_result := ut_be_within(a_dist,0).negated;
733+
l_result.expectation := self;
734+
return treat(l_result as ut_be_within);
735+
end;
736+
737+
member function not_to_be_within(a_dist dsinterval_unconstrained) return ut_be_within is
738+
l_result ut_matcher;
739+
begin
740+
l_result := ut_be_within(a_dist,0).negated;
741+
l_result.expectation := self;
742+
return treat(l_result as ut_be_within);
743+
end;
744+
745+
member function not_to_be_within(a_dist yminterval_unconstrained) return ut_be_within is
746+
l_result ut_matcher;
747+
begin
748+
l_result := ut_be_within(a_dist,0).negated;
749+
l_result.expectation := self;
750+
return treat(l_result as ut_be_within);
751+
end;
752+
753+
member function not_to_be_within_pct(a_dist natural) return ut_be_within is
754+
l_result ut_matcher;
755+
begin
756+
l_result := ut_be_within(a_dist,0).negated;
757+
l_result.expectation := self;
758+
return treat(l_result as ut_be_within);
759+
end;
728760

729761
end;
730762
/
763+

source/expectations/ut_expectation.tps

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,13 @@ create or replace type ut_expectation under ut_expectation_base(
167167
member function to_be_within(a_dist natural) return ut_be_within,
168168
member function to_be_within(a_dist dsinterval_unconstrained) return ut_be_within,
169169
member function to_be_within(a_dist yminterval_unconstrained) return ut_be_within,
170-
member function to_be_within_pct(a_dist natural) return ut_be_within
170+
member function to_be_within_pct(a_dist natural) return ut_be_within,
171+
172+
member function not_to_be_within(a_dist natural) return ut_be_within,
173+
member function not_to_be_within(a_dist dsinterval_unconstrained) return ut_be_within,
174+
member function not_to_be_within(a_dist yminterval_unconstrained) return ut_be_within,
175+
member function not_to_be_within_pct(a_dist natural) return ut_be_within
176+
171177
)
172178
not final
173179
/

source/expectations/ut_expectation_base.tps

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
create or replace type ut_expectation_base force authid current_user as object(
1+
create or replace type ut_expectation_base authid current_user as object(
22
/*
33
utPLSQL - Version 3
44
Copyright 2016 - 2019 utPLSQL Project

test/ut3_tester/core/test_ut_utils.pks

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,28 +130,28 @@ create or replace package test_ut_utils is
130130

131131
--%context(interval_converter_to_strin)
132132

133-
--%test(Test day to second interval passing a second)
133+
--%test(returns text representation of interval day to second for 1 second interval)
134134
procedure int_conv_ds_sec;
135135

136-
--%test(Test day to second interval passing a minute)
136+
--%test(returns text representation of interval day to second for 1 minute interval)
137137
procedure int_conv_ds_minute;
138138

139-
--%test(Test day to second interval passing a hour)
139+
--%test(returns text representation of interval day to second for 1 hour interval)
140140
procedure int_conv_ds_hour;
141141

142-
--%test(Test day to second interval passing a day)
142+
--%test(returns text representation of interval day to second for 1 day interval)
143143
procedure int_conv_ds_day;
144144

145-
--%test(Test day to second interval passing a custom date )
145+
--%test(returns text representation of interval day to second for combination interval)
146146
procedure int_conv_ds_date;
147147

148-
--%test(Test year to month interval passing a hour)
148+
--%test(returns text representation of interval year to month for 1 year interval)
149149
procedure int_conv_ym_year;
150150

151-
--%test(Test year to month interval passing a day)
151+
--%test(returns text representation of interval year to month for 1 month interval)
152152
procedure int_conv_ym_month;
153153

154-
--%test(Test year to month interval passing a custom date )
154+
--%test(returns text representation of interval year to month for custom interval)
155155
procedure int_conv_ym_date;
156156

157157

test/ut3_tester_helper/expectations_helper.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
create or replace package body ut3_tester_helper.expectations_helper is
1+
create or replace package body expectations_helper is
22

33
function unary_expectation_block(
44
a_matcher_name varchar2,

test/ut3_user/expectations/binary/test_to_be_within.pkb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,4 +138,4 @@ create or replace package body test_to_be_within is
138138
end;
139139

140140
end;
141-
/
141+
/

test/ut3_user/expectations/binary/test_to_be_within.pks

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ create or replace package test_to_be_within is
66
--%aftereach
77
procedure cleanup_expectations;
88

9-
--%test(Gives failure when number is not within positive distance)
9+
--%test(gives success for values within a distance)
1010
procedure success_tests;
1111

12-
--%test(Gives failure when number is not within negative distance)
12+
--%test(gives failure when number is not within distance)
1313
procedure failed_tests;
1414

1515
--%test(Check failure message for number not within)
@@ -25,7 +25,7 @@ create or replace package test_to_be_within is
2525
procedure fail_for_ym_int_not_within;
2626

2727
--%test(Check failure message for custom ym interval not within)
28-
procedure fail_for_custom_ym_int;
28+
procedure fail_for_custom_ym_int;
2929

3030
end;
31-
/
31+
/

0 commit comments

Comments
 (0)