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

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added shortcuts to all the matchers
  • Loading branch information
Pazus committed May 1, 2017
commit 864431669375f5137d0e143439111e2855d98d38
25 changes: 25 additions & 0 deletions source/expectations/ut_expectation_date.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,31 @@ create or replace type body ut_expectation_date as
ut_utils.debug_log('ut_expectation_date.to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date)');
self.to_( ut_be_between(a_lower_bound,a_upper_bound) );
end;

member procedure to_be_greater_or_equal(self in ut_expectation_date, a_expected date) is

begin
ut_utils.debug_log('ut_expectation_date.to_be_greater_or_equal(self in ut_expectation_date, a_expected date)');
self.to_( ut_be_greater_or_equal (a_expected) );
end;

member procedure to_be_greater_than(self in ut_expectation_date, a_expected date) is
begin
ut_utils.debug_log('ut_expectation_date.to_be_greater_than(self in ut_expectation_date, a_expected date)');
self.to_( ut_be_greater_than (a_expected) );
end;

member procedure to_be_less_or_equal(self in ut_expectation_date, a_expected date) is
begin
ut_utils.debug_log('ut_expectation_date.to_be_less_or_equal(self in ut_expectation_date, a_expected date)');
self.to_( ut_be_less_or_equal (a_expected) );
end;

member procedure to_be_less_than(self in ut_expectation_date, a_expected date) is
begin
ut_utils.debug_log('ut_expectation_date.to_be_less_than(self in ut_expectation_date, a_expected date');
self.to_( ut_be_less_than (a_expected) );
end;

end;
/
6 changes: 5 additions & 1 deletion source/expectations/ut_expectation_date.tps
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ create or replace type ut_expectation_date under ut_expectation(
limitations under the License.
*/
overriding member procedure to_equal(self in ut_expectation_date, a_expected date, a_nulls_are_equal boolean := null),
member procedure to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date)
member procedure to_be_between(self in ut_expectation_date, a_lower_bound date, a_upper_bound date),
member procedure to_be_greater_or_equal(self in ut_expectation_date, a_expected date),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add:
not_to_be_greater_or_equal
not_to_be_greater_than
not_to_be_less_than
not_to_be_less_or_equal

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dont like the idea to add not_to_be_less_than cause its to_be_greater_or_equal etc.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

though implemented it)

member procedure to_be_greater_than(self in ut_expectation_date, a_expected date),
member procedure to_be_less_or_equal(self in ut_expectation_date, a_expected date),
member procedure to_be_less_than(self in ut_expectation_date, a_expected date)
)
/
21 changes: 21 additions & 0 deletions source/expectations/ut_expectation_dsinterval.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ create or replace type body ut_expectation_dsinterval as
ut_utils.debug_log('ut_expectation_dsinterval.to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)');
self.to_( ut_be_between(a_lower_bound,a_upper_bound) );
end;

member procedure to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_dsinterval.to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
self.to_( ut_be_greater_or_equal (a_expected) );
end;
member procedure to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_dsinterval.to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
self.to_( ut_be_greater_than (a_expected) );
end;
member procedure to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_dsinterval.to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
self.to_( ut_be_less_or_equal (a_expected) );
end;
member procedure to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_dsinterval.to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)');
self.to_( ut_be_less_than (a_expected) );
end;

end;
/
6 changes: 5 additions & 1 deletion source/expectations/ut_expectation_dsinterval.tps
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ create or replace type ut_expectation_dsinterval under ut_expectation(
limitations under the License.
*/
overriding member procedure to_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained, a_nulls_are_equal boolean := null),
member procedure to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)
member procedure to_be_between(self in ut_expectation_dsinterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained),
member procedure to_be_greater_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained),
member procedure to_be_greater_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained),
member procedure to_be_less_or_equal(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained),
member procedure to_be_less_than(self in ut_expectation_dsinterval, a_expected dsinterval_unconstrained)
)
/
24 changes: 24 additions & 0 deletions source/expectations/ut_expectation_number.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ create or replace type body ut_expectation_number as
ut_utils.debug_log('ut_expectation_number.to_be_between(self in ut_expectation_date, a_lower_bound number, a_upper_bound number)');
self.to_( ut_be_between(a_lower_bound,a_upper_bound) );
end;

member procedure to_be_greater_or_equal(self in ut_expectation_number, a_expected number) is
begin
ut_utils.debug_log('ut_expectation_number.to_be_greater_or_equal(self in ut_expectation_number, a_expected number)');
self.to_( ut_be_greater_or_equal (a_expected) );
end;

member procedure to_be_greater_than(self in ut_expectation_number, a_expected number) is
begin
ut_utils.debug_log('ut_expectation_number.to_be_greater_than(self in ut_expectation_number, a_expected number)');
self.to_( ut_be_greater_than (a_expected) );
end;

member procedure to_be_less_or_equal(self in ut_expectation_number, a_expected number) is
begin
ut_utils.debug_log('ut_expectation_number.to_be_less_or_equal(self in ut_expectation_number, a_expected number)');
self.to_( ut_be_less_or_equal (a_expected) );
end;

member procedure to_be_less_than(self in ut_expectation_number, a_expected number) is
begin
ut_utils.debug_log('ut_expectation_number.to_be_less_than(self in ut_expectation_number, a_expected number');
self.to_( ut_be_less_than (a_expected) );
end;

end;
/
6 changes: 5 additions & 1 deletion source/expectations/ut_expectation_number.tps
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ create or replace type ut_expectation_number under ut_expectation(
limitations under the License.
*/
overriding member procedure to_equal(self in ut_expectation_number, a_expected number, a_nulls_are_equal boolean := null),
member procedure to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number)
member procedure to_be_between(self in ut_expectation_number, a_lower_bound number, a_upper_bound number),
member procedure to_be_greater_or_equal(self in ut_expectation_number, a_expected number),
member procedure to_be_greater_than(self in ut_expectation_number, a_expected number),
member procedure to_be_less_or_equal(self in ut_expectation_number, a_expected number),
member procedure to_be_less_than(self in ut_expectation_number, a_expected number)
)
/
24 changes: 24 additions & 0 deletions source/expectations/ut_expectation_timestamp.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ create or replace type body ut_expectation_timestamp as
ut_utils.debug_log('ut_expectation_timestamp.to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained)');
self.to_( ut_be_between(a_lower_bound, a_upper_bound) );
end;

member procedure to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp.to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
self.to_( ut_be_greater_or_equal (a_expected) );
end;

member procedure to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp.to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
self.to_( ut_be_greater_than (a_expected) );
end;

member procedure to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp.to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
self.to_( ut_be_less_or_equal (a_expected) );
end;

member procedure to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp.to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)');
self.to_( ut_be_less_than (a_expected) );
end;

end;
/
6 changes: 5 additions & 1 deletion source/expectations/ut_expectation_timestamp.tps
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ create or replace type ut_expectation_timestamp under ut_expectation(
limitations under the License.
*/
overriding member procedure to_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained, a_nulls_are_equal boolean := null),
member procedure to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained)
member procedure to_be_between(self in ut_expectation_timestamp, a_lower_bound timestamp_unconstrained, a_upper_bound timestamp_unconstrained),
member procedure to_be_greater_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained),
member procedure to_be_greater_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained),
member procedure to_be_less_or_equal(self in ut_expectation_timestamp, a_expected timestamp_unconstrained),
member procedure to_be_less_than(self in ut_expectation_timestamp, a_expected timestamp_unconstrained)
)
/
21 changes: 21 additions & 0 deletions source/expectations/ut_expectation_timestamp_ltz.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ create or replace type body ut_expectation_timestamp_ltz as
ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained)');
self.to_( ut_be_between(a_lower_bound, a_upper_bound) );
end;

member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
self.to_( ut_be_greater_or_equal (a_expected) );
end;
member procedure to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
self.to_( ut_be_greater_than (a_expected) );
end;
member procedure to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
self.to_( ut_be_less_or_equal (a_expected) );
end;
member procedure to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_ltz.to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)');
self.to_( ut_be_less_than (a_expected) );
end;

end;
/
6 changes: 5 additions & 1 deletion source/expectations/ut_expectation_timestamp_ltz.tps
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ create or replace type ut_expectation_timestamp_ltz under ut_expectation(
limitations under the License.
*/
overriding member procedure to_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained, a_nulls_are_equal boolean := null),
member procedure to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained)
member procedure to_be_between(self in ut_expectation_timestamp_ltz, a_lower_bound timestamp_ltz_unconstrained, a_upper_bound timestamp_ltz_unconstrained),
member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained),
member procedure to_be_greater_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained),
member procedure to_be_less_or_equal(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained),
member procedure to_be_less_than(self in ut_expectation_timestamp_ltz, a_expected timestamp_ltz_unconstrained)
)
/
21 changes: 21 additions & 0 deletions source/expectations/ut_expectation_timestamp_tz.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ create or replace type body ut_expectation_timestamp_tz as
ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained)');
self.to_( ut_be_between(a_lower_bound, a_upper_bound) );
end;

member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)');
self.to_( ut_be_greater_or_equal (a_expected) );
end;
member procedure to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)');
self.to_( ut_be_greater_than (a_expected) );
end;
member procedure to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)');
self.to_( ut_be_less_or_equal (a_expected) );
end;
member procedure to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_timestamp_tz.to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)');
self.to_( ut_be_less_than (a_expected) );
end;

end;
/
6 changes: 5 additions & 1 deletion source/expectations/ut_expectation_timestamp_tz.tps
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ create or replace type ut_expectation_timestamp_tz under ut_expectation(
limitations under the License.
*/
overriding member procedure to_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained, a_nulls_are_equal boolean := null),
member procedure to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained)
member procedure to_be_between(self in ut_expectation_timestamp_tz, a_lower_bound timestamp_tz_unconstrained, a_upper_bound timestamp_tz_unconstrained),
member procedure to_be_greater_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained),
member procedure to_be_greater_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained),
member procedure to_be_less_or_equal(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained),
member procedure to_be_less_than(self in ut_expectation_timestamp_tz, a_expected timestamp_tz_unconstrained)
)
/
21 changes: 21 additions & 0 deletions source/expectations/ut_expectation_yminterval.tpb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,27 @@ create or replace type body ut_expectation_yminterval as
ut_utils.debug_log('ut_expectation_yminterval.to_be_between(self in ut_expectation_yminterval, a_lower_bound dsinterval_unconstrained, a_upper_bound dsinterval_unconstrained)');
self.to_( ut_be_between(a_lower_bound,a_upper_bound) );
end;

member procedure to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_yminterval.to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)');
self.to_( ut_be_greater_or_equal (a_expected) );
end;
member procedure to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_yminterval.to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)');
self.to_( ut_be_greater_than (a_expected) );
end;
member procedure to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_yminterval.to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)');
self.to_( ut_be_less_or_equal (a_expected) );
end;
member procedure to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained) is
begin
ut_utils.debug_log('ut_expectation_yminterval.to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)');
self.to_( ut_be_less_than (a_expected) );
end;

end;
/
6 changes: 5 additions & 1 deletion source/expectations/ut_expectation_yminterval.tps
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ create or replace type ut_expectation_yminterval under ut_expectation(
limitations under the License.
*/
overriding member procedure to_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained, a_nulls_are_equal boolean := null),
member procedure to_be_between(self in ut_expectation_yminterval, a_lower_bound yminterval_unconstrained, a_upper_bound yminterval_unconstrained)
member procedure to_be_between(self in ut_expectation_yminterval, a_lower_bound yminterval_unconstrained, a_upper_bound yminterval_unconstrained),
member procedure to_be_greater_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained),
member procedure to_be_greater_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained),
member procedure to_be_less_or_equal(self in ut_expectation_yminterval, a_expected yminterval_unconstrained),
member procedure to_be_less_than(self in ut_expectation_yminterval, a_expected yminterval_unconstrained)
)
/