dox Executable Documentation

Create task

Successful creation

Given I have entered the 'task' '/some/new/task'
Given I have entered the 'deadline' '2001-01-01T12:00'
Given I have entered the 'duration' '2:42'
Given I have entered the 'description' 'Some description'
When I create a new task
Then there should be a task 'some/new/task'
Then 'some/new/task' should have the deadline '2001-01-01 12:00'
Then 'some/new/task' should have the duration 2 hours and 42 minutes
Then 'some/new/task' should have the description 'Some description'
Then the task created message for '/some/new/task' should be displayed

Only name given

Given I have entered the 'task' '/some/new/task'
When I create a new task with just the name
Then there should be a task 'some/new/task'
Then 'some/new/task' should have no deadline
Then 'some/new/task' should have the default duration
Then 'some/new/task' should have no description
Then the task created message for '/some/new/task' should be displayed

Missing name

Given I have entered the 'task' ' '
When I create a new task with just the name
Then there should no tasks
Then the error message 'Could not create task. No name given.' should be displayed

Existing task

Given the task 'existing/task' exists
Given I have entered the 'task' 'existing/task'
When I create a new task with just the name
Then there should be a task 'existing/task'
Then the error message 'Could not create task since it already exists.' should be displayed

Duration in decimal hours

Given I have entered the 'task' '/some/new/task'
Given I have entered the 'duration' '2.62'
When I create a new task
Then 'some/new/task' should have the duration 2 hours and 37 minutes
Then the task created message for '/some/new/task' should be displayed

Invalid duration format

Given I have entered the 'task' '/some/new/task'
Given I have entered the 'duration' 'NaN'
When I try to create a new task
Then an exception should be thrown