Given the task 'one' in 'root'

When I create the schedule

Then there should be 1 slots in the schedule

Then slot 1 should be task 'one'

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given the task 'three' in 'root'

Given 'one' has the deadline 'tomorrow'

Given 'two' has the deadline 'next week'

Given 'three' has the deadline 'today'

When I create the schedule

Then there should be 3 slots in the schedule

Then slot 1 should be task 'three'

Then slot 2 should be task 'one'

Then slot 3 should be task 'two'

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given the task 'three' in 'root'

Given 'one' has the deadline 'tomorrow'

Given 'three' has the deadline 'next week'

When I create the schedule

Then there should be 3 slots in the schedule

Then slot 1 should be task 'one'

Then slot 2 should be task 'three'

Then slot 3 should be task 'two'

Given the task 'a' in 'root'

Given the task 'b' in 'root'

Given the task 'aa' in 'a'

Given the task 'ab' in 'a'

Given the task 'ba' in 'b'

Given the task 'bb' in 'b'

Given 'b' has the priority 1

Given 'a' has the priority 2

Given 'ab' has the priority 3

Given 'bb' has the priority 4

Given 'aa' has the priority 5

When I create the schedule

Then there should be 4 slots in the schedule

Then slot 1 should be task 'bb'

Then slot 2 should be task 'ba'

Then slot 3 should be task 'ab'

Then slot 4 should be task 'aa'

Given the task 'a' in 'root'

Given the task 'b' in 'root'

Given the task 'one' in 'a'

Given the task 'two' in 'a'

Given the task 'three' in 'b'

Given the task 'four' in 'b'

When I create the schedule

Then there should be 4 slots in the schedule

Then slot 1 should be task 'one'

Then slot 2 should be task 'two'

Then slot 3 should be task 'four'

Then slot 4 should be task 'three'

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given 'one' is done

When I create the schedule

Then there should be 1 slots in the schedule

Then slot 1 should be task 'two'

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given the task 'one_one' in 'one'

Given 'one' is done

When I create the schedule

Then there should be 1 slots in the schedule

Then slot 1 should be task 'two'

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given the task 'one_one' in 'one'

Given the task 'leaf_one' in 'one'

Given the task 'leaf_two' in 'one_one'

Given the task 'leaf_three' in 'two'

Given 'one' takes 0 minutes

When I create the schedule

Then there should be 3 slots in the schedule

Then schedule should contain 'leaf_one'

Then schedule should contain 'leaf_two'

Then schedule should contain 'leaf_three'

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given the task 'one_one' in 'one'

Given the task 'leaf_one' in 'one'

Given the task 'leaf_two' in 'one_one'

Given the task 'leaf_three' in 'two'

Given 'leaf_two' is done

When I create the schedule

Then there should be 3 slots in the schedule

Then schedule should contain 'leaf_one'

Then schedule should contain 'one_one'

Then schedule should contain 'leaf_three'

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given the task 'three' in 'root'

Given 'three' has the deadline 'today'

Given 'one' takes 0 minutes

Given 'two' takes 1 minutes

Given I have logged 2 minutes for 'two'

When I create the schedule

Then there should be 2 slots in the schedule

Then slot 1 should be task 'three'

Then slot 2 should be task 'two'

Given the task 'one' in 'root'

Given 'one' takes 1 minutes

When I create the schedule

Then there should be 1 slots in the schedule

Then slot 1 should be 1 minutes

Given the task 'one' in 'root'

Given 'one' takes 11 minutes

When I create the schedule

Then there should be 1 slots in the schedule

Then slot 1 should be 11 minutes

Given the task 'one' in 'root'

Given the task 'one_one' in 'one'

Given the task 'one_two' in 'one'

Given the task 'two' in 'root'

Given 'one' has the deadline 'today'

Given 'one_two' has the deadline 'next week'

Given 'two' has the deadline 'tomorrow'

When I create the schedule

Then there should be 3 slots in the schedule

Then slot 1 should be task 'one_one'

Then slot 2 should be task 'two'

Then slot 3 should be task 'one_two'

Given the task 'one' in 'root'

Given 'one' takes 12 minutes

Given I have logged 5 minutes for 'one'

When I create the schedule

Then slot 1 should be 7 minutes

Given the task 'one' in 'root'

Given 'one' takes 12 minutes

Given 'one' has a window from 'now' until '5 minutes'

Given 'one' has a window from '7 minutes' until '17 minutes'

When I create the schedule

Then there should be 2 slots in the schedule

Then slot 1 should be 5 minutes

Then slot 2 should be 7 minutes

Given the task 'one' in 'root'

Given 'one' takes 12 minutes

Given 'root' has a window from '2 minutes' until '20 minutes'

Given 'one' has a window from 'now' until '5 minutes'

Given 'one' has a window from '7 minutes' until '14 minutes'

Given 'one' has a window from '15 minutes' until '20 minutes'

When I create the schedule

Then there should be 3 slots in the schedule

Then slot 1 should be 3 minutes

Then slot 2 should be 7 minutes

Then slot 3 should be 2 minutes

Given the task 'one' in 'root'

Given 'one' takes 10 minutes

Given 'one' has a window from 'now' until '5 minutes' with a quota of 2 minutes

Given 'one' has a window from '7 minutes' until '17 minutes' with a quota of 5 minutes

Given 'one' has a window from '20 minutes' until '25 minutes' with a quota of 5 minutes

When I create the schedule

Then there should be 3 slots in the schedule

Then slot 1 should be 2 minutes

Then slot 2 should be 5 minutes

Then slot 3 should be 3 minutes

Given the task 'one' in 'root'

Given the task 'two' in 'root'

Given the task 'three' in 'root'

Given 'one' has the deadline 'today'

Given 'two' has the deadline 'tomorrow'

Given 'three' has the deadline 'next week'

Given 'one' depends on 'two'

Given 'two' depends on 'three'

When I create the schedule

Then there should be 3 slots in the schedule

Then slot 1 should be task 'three'

Then slot 2 should be task 'two'

Then slot 3 should be task 'one'

Given the repeating task 'one' in 'root'

Given 'one' is repeated each 30 minutes

Given 'one' takes 5 minutes

Given 'one' has a window from 'now' until '2 minutes'

Given 'one' has a window from '4 minutes' until '8 minutes'

When I create the schedule

Then there should be 8 slots in the schedule

Then slot 1 should start 'now'

Then slot 1 should be 2 minutes

Then slot 2 should start '4 minutes'

Then slot 2 should be 3 minutes

Then slot 3 should start '30 minutes'

Then slot 3 should be 2 minutes

Then slot 4 should start '34 minutes'

Then slot 4 should be 3 minutes

Given the task 'one' in 'root'

Given 'one' takes '10' minutes

Given 'one' has a window from 'now' until '2 minutes'

Given the windows of 'one' are repeated every 15 minutes

Given 'one' has a window from '4 minutes' until '6 minutes'

When I create the schedule

Then there should be 5 slots in the schedule

Then slot 1 should start 'now'

Then slot 2 should start '4 minutes'

Then slot 3 should start '15 minutes'

Then slot 4 should start '19 minutes'

Then slot 5 should start '30 minutes'

Given the repeating task 'one' in 'root'

When I try to repeat the windows of 'one'

Then an exception should be thrown