Revision: 2625
Author: janne.t.harkonen
Date: Mon Mar 15 06:43:29 2010
Log: Added resource, changed date format, started implementing add user
keywords
http://code.google.com/p/robotframework/source/detail?r=2625
Added:
/trunk/proto/atdd_example/atest/resource.txt
Modified:
/trunk/proto/atdd_example/atest/add_employee.txt
/trunk/proto/atdd_example/atest/amount_of_vacation.txt
=======================================
--- /dev/null
+++ /trunk/proto/atdd_example/atest/resource.txt Mon Mar 15 06:43:29 2010
@@ -0,0 +1,2 @@
+*** Settings ***
+Library VacalcLibrary
=======================================
--- /trunk/proto/atdd_example/atest/add_employee.txt Mon Mar 15 04:44:08
2010
+++ /trunk/proto/atdd_example/atest/add_employee.txt Mon Mar 15 06:43:29
2010
@@ -1,18 +1,31 @@
*** Test Cases ***
Add employee
- Given no users exists in the system
- When employee Janne H is added with start date 1.1.2010
- Then message "Succesfully added user 'Janne H' with start date 1.1.2010"
is shown
+ Given no users exist in the system
+ When employee Janne H is added with start date 2010-1-1
+ Then message "Successfully added user 'Janne H'." is shown
Added Employee is done persistently
- Given no users exists in the system
- And employee Pekka L is added with start date 1.1.2009
- When user queries info about Pekka L
- Then message "Pekka L: start date 1.1.2009" is shown
+ Given no users exist in the system
+ And employee Pekka K is added with start date 2009-1-1
+ When user queries info about Pekka K
+ Then message "Pekka K: start date 2009-1-1" is shown
Add already existing employee
- Given no users exists in the system
- And employee JR is added with start date 1.1.2009
- When employee JR is added with start date 1.1.2010
- Then error message "Employee 'JR' already exists in the system with
start date 1.1.2009" is shown
+ Given no users exist in the system
+ And employee JR is added with start date 2009-1-1
+ When employee JR is added with start date 2010-1-1
+ Then error message "Employee 'JR' already exists in the system with
start date 2009-1-1" is shown
+
+*** Keywords ***
+Given no users exist in the system
+ Clear Database
+
+Employee ${name} is added with start date ${date}
+ Add User ${name} ${date}
+
+Then message "${msg}" is shown
+ Status Should Be ${msg}
+
+*** Settings ***
+Resource resource.txt
=======================================
--- /trunk/proto/atdd_example/atest/amount_of_vacation.txt Mon Mar 15
04:20:30 2010
+++ /trunk/proto/atdd_example/atest/amount_of_vacation.txt Mon Mar 15
06:43:29 2010
@@ -1,23 +1,23 @@
*** Test Cases ***
Employee has worked less than a year before the holiday credit year starts
- Given employee starts working 1.1.2010
+ Given employee starts working 2010-1-1
When she works 14 or more days per month
Then she has 6 day vacation on the holiday credit year 2010 (period from
1 April 2010 to 31 March 2011)
Employee has worked exactly a year before the holiday credit year starts
- When employee starts on 1.4.2009 then she has 24 day vacation on year
2010
+ When employee starts on 2009-4-1 then she has 24 day vacation on year
2010
Employee has worked day over a year before the holiday credit year starts
- When employee starts on 31.3.2009 then she has 30 day vacation on year
2010
+ When employee starts on 2009-3-31 then she has 30 day vacation on year
2010
Employee has less than 14 days during the first month of employment
- When employee starts on 10.2.2010 then she has 2 day vacation on year
2010
+ When employee starts on 2010-2-10 then she has 2 day vacation on year
2010
Employee has 14 days during the first month of employment
- When employee starts on 9.2.2010 then she has 4 day vacation on year 2010
+ When employee starts on 2010-2-9 then she has 4 day vacation on year 2010
Employee has worked years before the holiday credit year starts
- When employee starts on 21.1.2000 then she has 30 day vacation on year
2010
+ When employee starts on 2000-1-21 then she has 30 day vacation on year
2010
*** Keywords ***
When employee starts on ${startdate} then she has ${exp_vacation} day
vacation on year ${year}
@@ -25,5 +25,5 @@
Should Be Equal As Integers ${vacation} ${exp_vacation}
*** Settings ***
-Library vacalc.VacationCalculatorLibrary
-
+Resource resource.txt
+