Permalink
Fetching contributors…
Cannot retrieve contributors at this time
72 lines (49 sloc) 3.24 KB

Feature: A user cancels the deposit

A customer is able to cancel the deposit earlier. In such case they will receive the full amount, but the interest may be not as high as it would be if they did not cancel their deposit prematurely.

Scenario: Calculate the amount to be transferred after the cancellation

Given an X year(s) long time deposit

And the initial amount of Y pounds

And the interest rate of Z% a year

When I cancel the deposit after MONTHS months and DAYS days

Then I should have TRANSFERRED pounds transferred to my account

Business rules:

One receives the same amount as deposited if the deposit cancelled during the first half

For 1 year long deposit with 100 initial amount and 2% interest rate, when I cancel it after MONTHS and DAYS:

| cancelMONTHS | DAYS | TRANSFERRED || | :------------------------: | :----------: | :-------------------------: | | 0 | 7 | 100 | | 6 | 0 | 100 |

One receives the deposited amount plus half of the interest if the deposit cancelled after 6 months and within the first year

For 1 year long deposit with 100 initial amount and 2% interest rate, when I cancel it after MONTHS and DAYS:

| cancelMONTHS | DAYS | TRANSFERRED || | :------------------------: | :----------: | :-------------------------: | | 6 | 1 | 101 | | 12 | 0 | 101 |

The deposit is automatically renewed if not cancelled

For 1 year long deposit with 100 initial amount and 2% interest rate, when I cancel it after MONTHS and DAYS:

| cancelMONTHS | DAYS | TRANSFERRED || | :------------------------: | :----------: | :-------------------------: | | 12 | 1 | 102 | | 18 | 0 | 102 | | 18 | 1 | 103 | | 24 | 1 | 104 |

One cannot cancel the deposit before 7th day

For 1 year long deposit with 100 initial amount and 2% interest rate, when I cancel it after MONTHS and DAYS:

| cancelMONTHS | DAYS | TRANSFERRED || | :------------------------: | :----------: | :-------------------------: | | 0 | 0 | X | | 0 | 6 | X |