|
Lines 73-79
subtest 'total() tests' => sub {
Link Here
|
| 73 |
$schema->storage->txn_rollback; |
73 |
$schema->storage->txn_rollback; |
| 74 |
}; |
74 |
}; |
| 75 |
|
75 |
|
| 76 |
subtest 'filter_by_non_reversable() and filter_by_reversable() tests' => sub { |
76 |
subtest 'filter_by_non_reversible() and filter_by_reversible() tests' => sub { |
| 77 |
|
77 |
|
| 78 |
plan tests => 4; |
78 |
plan tests => 4; |
| 79 |
|
79 |
|
|
Lines 90-105
subtest 'filter_by_non_reversable() and filter_by_reversable() tests' => sub {
Link Here
|
| 90 |
$account->pay( { amount => 4, type => 'PAYMENT' } ); |
90 |
$account->pay( { amount => 4, type => 'PAYMENT' } ); |
| 91 |
$account->pay( { amount => 5, type => 'CREDIT' } ); |
91 |
$account->pay( { amount => 5, type => 'CREDIT' } ); |
| 92 |
|
92 |
|
| 93 |
# non-reversable offsets |
93 |
# non-reversible offsets |
| 94 |
is( $manual_fee->debit_offsets->filter_by_non_reversable->count, |
94 |
is( $manual_fee->debit_offsets->filter_by_non_reversible->count, |
| 95 |
3, '3 non-reversable offsets' ); |
95 |
3, '3 non-reversible offsets' ); |
| 96 |
is( $manual_fee->debit_offsets->filter_by_non_reversable->total, |
96 |
is( $manual_fee->debit_offsets->filter_by_non_reversible->total, |
| 97 |
-6, '-6 the total amount of the non-reversable offsets' ); |
97 |
-6, '-6 the total amount of the non-reversible offsets' ); |
| 98 |
# reversable offsets |
98 |
# reversible offsets |
| 99 |
is( $manual_fee->debit_offsets->filter_by_reversable->count, |
99 |
is( $manual_fee->debit_offsets->filter_by_reversible->count, |
| 100 |
2, 'The right reversable offsets count' ); |
100 |
2, 'The right reversible offsets count' ); |
| 101 |
is( $manual_fee->debit_offsets->filter_by_reversable->total, |
101 |
is( $manual_fee->debit_offsets->filter_by_reversible->total, |
| 102 |
-5, 'The right total amount of the reversable offsets' ); |
102 |
-5, 'The right total amount of the reversible offsets' ); |
| 103 |
|
103 |
|
| 104 |
$schema->storage->txn_rollback; |
104 |
$schema->storage->txn_rollback; |
| 105 |
}; |
105 |
}; |
| 106 |
- |
|
|