Report generated 11-04-2023 10:42

Feature: EDATE Function

Computes and returns a date on the same day of the month, n months before or after a specified date. You can use it to calculate expiration dates, maturity dates, contract dates, and other due dates.
This function behave exactly as Excel EDATE function.

There is only one keyword argument

- months:  
    The value to specify may be negative or positive; Use a positive value to get a date in the future, and a negative value to get a date in the past.  

Notice:

This function maintains the last day of month when a day is 31. See the below second scenario outline for more details.

Scenarios

Given the date {start date}

When relative delta {relative delta} is applied

Then the relative date should be {relative date}

Examples:

descriptionstart daterelative deltarelative date
next month2021-09-20months=+12021-10-20
last month2021-09-20months=-12021-08-20
next two months2021-09-20months=+22021-11-20
next three months2021-09-20months=+32021-12-20
next four months2021-09-20months=+42022-01-20
next five months2021-09-20months=+52022-02-20

It maintains the last day of month when a day is 31.

Given the date {start date}

When relative delta {relative delta} is applied

Then the relative date should be {relative date}

Examples:

descriptionstart daterelative deltarelative date
next month2021-10-31months=+12021-11-30
last month2021-10-31months=-12021-09-30
next two months2021-10-31months=+22021-12-31
next three months2021-10-31months=+32022-01-31
next four months2021-10-31months=+42022-02-28
next five months2021-10-31months=+52022-03-31

Feature Coverage By Scenario

Test Outcomes

Test Performance

Key Statistics

Number of Scenarios 2 Total Duration 314ms
Total Number of Test Cases 12 Fastest Test 18ms
Number of Manual Test Cases 0 Slowest Test 33ms
Tests Started Apr 11, 2023 10:42:07 Average Execution Time 21ms
Tests Finished Apr 11, 2023 10:42:07 Total Execution Time 312ms

Automated Tests

feature Scenario Context Steps Started Total Duration Result
EDATE Function 1: The start date do not involve last day of month
description=next month, start date=2021-09-20, relative delta=months=+1, relative date=2021-10-20
windows 3 10:42:07 033ms SUCCESS
EDATE Function 2: The start date do not involve last day of month
description=last month, start date=2021-09-20, relative delta=months=-1, relative date=2021-08-20
windows 3 10:42:07 029ms SUCCESS
EDATE Function 3: The start date do not involve last day of month
description=next two months, start date=2021-09-20, relative delta=months=+2, relative date=2021-11-20
windows 3 10:42:07 028ms SUCCESS
EDATE Function 4: The start date do not involve last day of month
description=next three months, start date=2021-09-20, relative delta=months=+3, relative date=2021-12-20
windows 3 10:42:07 019ms SUCCESS
EDATE Function 5: The start date do not involve last day of month
description=next four months, start date=2021-09-20, relative delta=months=+4, relative date=2022-01-20
windows 3 10:42:07 020ms SUCCESS
EDATE Function 6: The start date do not involve last day of month
description=next five months, start date=2021-09-20, relative delta=months=+5, relative date=2022-02-20
windows 3 10:42:07 018ms SUCCESS
EDATE Function 1: The start date with 31 as last day
description=next month, start date=2021-10-31, relative delta=months=+1, relative date=2021-11-30
windows 3 10:42:07 021ms SUCCESS
EDATE Function 2: The start date with 31 as last day
description=last month, start date=2021-10-31, relative delta=months=-1, relative date=2021-09-30
windows 3 10:42:07 019ms SUCCESS
EDATE Function 3: The start date with 31 as last day
description=next two months, start date=2021-10-31, relative delta=months=+2, relative date=2021-12-31
windows 3 10:42:07 019ms SUCCESS
EDATE Function 4: The start date with 31 as last day
description=next three months, start date=2021-10-31, relative delta=months=+3, relative date=2022-01-31
windows 3 10:42:07 019ms SUCCESS
EDATE Function 5: The start date with 31 as last day
description=next four months, start date=2021-10-31, relative delta=months=+4, relative date=2022-02-28
windows 3 10:42:07 018ms SUCCESS
EDATE Function 6: The start date with 31 as last day
description=next five months, start date=2021-10-31, relative delta=months=+5, relative date=2022-03-31
windows 3 10:42:07 018ms SUCCESS

Manual Tests

No manual tests were recorded
Serenity BDD version 3.6.22