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

Skip to content

Commit 83f13b9

Browse files
committed
not_to shortcut for greater/less expectations
1 parent d116234 commit 83f13b9

14 files changed

Lines changed: 191 additions & 7 deletions

source/expectations/ut_expectation_date.tpb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@ create or replace type body ut_expectation_date as
6262
ut_utils.debug_log('ut_expectation_date.not_to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date)');
6363
self.not_to( ut_be_between(a_lower_bound,a_upper_bound) );
6464
end;
65+
66+
member procedure not_to_be_greater_or_equal(self in ut_expectation_date, a_expected date) is
67+
begin
68+
ut_utils.debug_log('ut_expectation_date.not_to_be_greater_or_equal(self in ut_expectation_date, a_expected date)');
69+
self.not_to( ut_be_greater_or_equal (a_expected) );
70+
end;
71+
72+
member procedure not_to_be_greater_than(self in ut_expectation_date, a_expected date) is
73+
begin
74+
ut_utils.debug_log('ut_expectation_date.not_to_be_greater_than(self in ut_expectation_date, a_expected date)');
75+
self.not_to( ut_be_greater_than (a_expected) );
76+
end;
77+
78+
member procedure not_to_be_less_or_equal(self in ut_expectation_date, a_expected date) is
79+
begin
80+
ut_utils.debug_log('ut_expectation_date.not_to_be_less_or_equal(self in ut_expectation_date, a_expected date)');
81+
self.not_to( ut_be_less_or_equal (a_expected) );
82+
end;
83+
84+
member procedure not_to_be_less_than(self in ut_expectation_date, a_expected date) is
85+
begin
86+
ut_utils.debug_log('ut_expectation_date.not_to_be_less_than(self in ut_expectation_date, a_expected date');
87+
self.not_to( ut_be_less_than (a_expected) );
88+
end;
6589

6690
end;
6791
/

source/expectations/ut_expectation_date.tps

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ create or replace type ut_expectation_date under ut_expectation(
2323
member procedure to_be_less_than(self in ut_expectation_date, a_expected date),
2424

2525
overriding member procedure not_to_equal(self in ut_expectation_date, a_expected date, a_nulls_are_equal boolean := null),
26-
member procedure not_to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date)
26+
member procedure not_to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date),
27+
member procedure not_to_be_greater_or_equal(self in ut_expectation_date, a_expected date),
28+
member procedure not_to_be_greater_than(self in ut_expectation_date, a_expected date),
29+
member procedure not_to_be_less_or_equal(self in ut_expectation_date, a_expected date),
30+
member procedure not_to_be_less_than(self in ut_expectation_date, a_expected date)
2731
)
2832
/

source/expectations/ut_expectation_dsinterval.tpb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,27 @@ create or replace type body ut_expectation_dsinterval as
5959
ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)');
6060
self.not_to( ut_be_between(a_lower_bound,a_upper_bound) );
6161
end;
62+
63+
member procedure not_to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
64+
begin
65+
ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
66+
self.not_to( ut_be_greater_or_equal (a_expected) );
67+
end;
68+
member procedure not_to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
69+
begin
70+
ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
71+
self.not_to( ut_be_greater_than (a_expected) );
72+
end;
73+
member procedure not_to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
74+
begin
75+
ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
76+
self.not_to( ut_be_less_or_equal (a_expected) );
77+
end;
78+
member procedure not_to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
79+
begin
80+
ut_utils.debug_log('ut_expectation_dsinterval.not_to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
81+
self.not_to( ut_be_less_than (a_expected) );
82+
end;
6283

6384
end;
6485
/

source/expectations/ut_expectation_dsinterval.tps

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ create or replace type ut_expectation_dsinterval under ut_expectation(
2323
member procedure to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained),
2424

2525
overriding member procedure not_to_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null),
26-
member procedure not_to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)
26+
member procedure not_to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained),
27+
member procedure not_to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained),
28+
member procedure not_to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained),
29+
member procedure not_to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained),
30+
member procedure not_to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)
2731
)
2832
/

source/expectations/ut_expectation_number.tpb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@ create or replace type body ut_expectation_number as
6262
ut_utils.debug_log('ut_expectation_number.not_to_be_between(self in ut_expectation_date, a_lower_bound number, a_upper_bound number)');
6363
self.not_to( ut_be_between(a_lower_bound,a_upper_bound) );
6464
end;
65+
66+
member procedure not_to_be_greater_or_equal(self in ut_expectation_number, a_expected number) is
67+
begin
68+
ut_utils.debug_log('ut_expectation_number.not_to_be_greater_or_equal(self in ut_expectation_number, a_expected number)');
69+
self.not_to( ut_be_greater_or_equal (a_expected) );
70+
end;
71+
72+
member procedure not_to_be_greater_than(self in ut_expectation_number, a_expected number) is
73+
begin
74+
ut_utils.debug_log('ut_expectation_number.not_to_be_greater_than(self in ut_expectation_number, a_expected number)');
75+
self.not_to( ut_be_greater_than (a_expected) );
76+
end;
77+
78+
member procedure not_to_be_less_or_equal(self in ut_expectation_number, a_expected number) is
79+
begin
80+
ut_utils.debug_log('ut_expectation_number.not_to_be_less_or_equal(self in ut_expectation_number, a_expected number)');
81+
self.not_to( ut_be_less_or_equal (a_expected) );
82+
end;
83+
84+
member procedure not_to_be_less_than(self in ut_expectation_number, a_expected number) is
85+
begin
86+
ut_utils.debug_log('ut_expectation_number.not_to_be_less_than(self in ut_expectation_number, a_expected number');
87+
self.not_to( ut_be_less_than (a_expected) );
88+
end;
6589

6690
end;
6791
/

source/expectations/ut_expectation_number.tps

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ create or replace type ut_expectation_number under ut_expectation(
2323
member procedure to_be_less_than(self in ut_expectation_number, a_expected number),
2424

2525
overriding member procedure not_to_equal(self in ut_expectation_number, a_expected number, a_nulls_are_equal boolean := null),
26-
member procedure not_to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number)
26+
member procedure not_to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number),
27+
member procedure not_to_be_greater_or_equal(self in ut_expectation_number, a_expected number),
28+
member procedure not_to_be_greater_than(self in ut_expectation_number, a_expected number),
29+
member procedure not_to_be_less_or_equal(self in ut_expectation_number, a_expected number),
30+
member procedure not_to_be_less_than(self in ut_expectation_number, a_expected number)
2731
)
2832
/

source/expectations/ut_expectation_timestamp.tpb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@ create or replace type body ut_expectation_timestamp as
6262
ut_utils.debug_log('ut_expectation_timestamp.not_to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained)');
6363
self.not_to( ut_be_between(a_lower_bound, a_upper_bound) );
6464
end;
65+
66+
member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
67+
begin
68+
ut_utils.debug_log('ut_expectation_timestamp.not_to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
69+
self.not_to( ut_be_greater_or_equal (a_expected) );
70+
end;
71+
72+
member procedure not_to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
73+
begin
74+
ut_utils.debug_log('ut_expectation_timestamp.not_to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
75+
self.not_to( ut_be_greater_than (a_expected) );
76+
end;
77+
78+
member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
79+
begin
80+
ut_utils.debug_log('ut_expectation_timestamp.not_to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
81+
self.not_to( ut_be_less_or_equal (a_expected) );
82+
end;
83+
84+
member procedure not_to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
85+
begin
86+
ut_utils.debug_log('ut_expectation_timestamp.not_to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
87+
self.not_to( ut_be_less_than (a_expected) );
88+
end;
6589

6690
end;
6791
/

source/expectations/ut_expectation_timestamp.tps

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ create or replace type ut_expectation_timestamp under ut_expectation(
2323
member procedure to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained),
2424

2525
overriding member procedure not_to_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null),
26-
member procedure not_to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained)
26+
member procedure not_to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained),
27+
member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained),
28+
member procedure not_to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained),
29+
member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained),
30+
member procedure not_to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)
2731
)
2832
/

source/expectations/ut_expectation_timestamp_ltz.tpb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,27 @@ create or replace type body ut_expectation_timestamp_ltz as
5959
ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained)');
6060
self.not_to( ut_be_between(a_lower_bound, a_upper_bound) );
6161
end;
62+
63+
member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
64+
begin
65+
ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
66+
self.not_to( ut_be_greater_or_equal (a_expected) );
67+
end;
68+
member procedure not_to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
69+
begin
70+
ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
71+
self.not_to( ut_be_greater_than (a_expected) );
72+
end;
73+
member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
74+
begin
75+
ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
76+
self.not_to( ut_be_less_or_equal (a_expected) );
77+
end;
78+
member procedure not_to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
79+
begin
80+
ut_utils.debug_log('ut_expectation_timestamp_ltz.not_to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
81+
self.not_to( ut_be_less_than (a_expected) );
82+
end;
6283

6384
end;
6485
/

source/expectations/ut_expectation_timestamp_ltz.tps

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ create or replace type ut_expectation_timestamp_ltz under ut_expectation(
2323
member procedure to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained),
2424

2525
overriding member procedure not_to_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null),
26-
member procedure not_to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained)
26+
member procedure not_to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained),
27+
member procedure not_to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained),
28+
member procedure not_to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained),
29+
member procedure not_to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained),
30+
member procedure not_to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)
2731
)
2832
/

0 commit comments

Comments
 (0)