Revision: 2647
Author: janne.t.harkonen
Date: Tue Mar 16 05:36:54 2010
Log: restructured
http://code.google.com/p/robotframework/source/detail?r=2647

Added:
 /trunk/proto/atdd_example/atest/vacalc
 /trunk/proto/atdd_example/atest/vacalc/add_employee.txt
 /trunk/proto/atdd_example/atest/vacalc/amount_of_vacation.txt
 /trunk/proto/atdd_example/atest/vacalc/query_amount_of_vacation.txt
 /trunk/proto/atdd_example/atest/vacalc/resource.txt

=======================================
--- /dev/null
+++ /trunk/proto/atdd_example/atest/vacalc/add_employee.txt Tue Mar 16 05:36:54 2010
@@ -0,0 +1,23 @@
+*** Test Cases ***
+
+Add employee
+    Given no users exist in the system
+    When employee Janne H is added with start date 2010-1-1
+    Then message "Successfully added employee 'Janne H'." is shown
+
+Added Employee is done persistently
+    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-01-01" is shown
+
+Add already existing employee
+    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" is shown
+
+
+*** Settings ***
+
+Resource  resource.txt
=======================================
--- /dev/null
+++ /trunk/proto/atdd_example/atest/vacalc/amount_of_vacation.txt Tue Mar 16 05:36:54 2010
@@ -0,0 +1,37 @@
+holiday credit year: period from 1 April to 31 March
+
+*** Test Cases ***
+Employee has started exactly a year before the holiday credit year starts
+ When employee starts on 2009-4-1 then she has 24 day vacation on year 2010
+
+Employee has started day over a year before the holiday credit year starts
+ 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
+  Amount of vacation should be  2010-2-10  2010  2
+
+Employee has 14 days during the first month of employment
+  Amount of vacation should be  2010-2-9  2010  4
+
+Employee has started during the holiday credit year
+  Amount of vacation should be  2010-6-1  2010  0
+
+Employee has started after the holiday credit year
+  Amount of vacation should be  2011-6-1  2010  0
+
+Employee has started more than year before the holiday credit year starts
+  Amount of vacation should be  2000-1-21  2010  30
+
+
+*** Keywords ***
+When employee starts on ${startdate} then she has ${expected vacation} day vacation on year ${year}
+  Amount of vacation should be  ${startdate}  ${year}  ${expected vacation}
+
+Amount of vacation should be
+ [Arguments] ${employee startdate} ${vacation year} ${expected amount of vacation} + ${amount of vacation} = Count Vacation ${employee startdate} ${vacation year} + Should Be Equal As Integers ${amount of vacation} ${expected amount of vacation}
+
+*** Settings ***
+Resource  resource.txt
+
=======================================
--- /dev/null
+++ /trunk/proto/atdd_example/atest/vacalc/query_amount_of_vacation.txt Tue Mar 16 05:36:54 2010
@@ -0,0 +1,22 @@
+*** Test Cases ***
+
+Employee vacations can be queried
+  Given no users exist in the system
+  And employee Kari H is added with start date 2010-1-1
+  When amount of vacation days for Kari H is queried for year 2010
+  Then message "Kari H has 6 vacation days in year 2010" is shown
+
+Employee vacations queary fails if employee does not exist
+  Given no users exist in the system
+  When amount of vacation days for Kari H is queried for year 2010
+  Then error message "Employee 'Kari H' not found" is shown
+
+
+*** User Keywords ***
+
+When amount of vacation days for ${name} is queried for year ${year}
+  Show vacation  ${name}  ${year}
+
+
+*** Settings ***
+Resource  resource.txt
=======================================
--- /dev/null
+++ /trunk/proto/atdd_example/atest/vacalc/resource.txt Tue Mar 16 05:36:54 2010
@@ -0,0 +1,22 @@
+*** Settings ***
+
+Library  VacalcLibrary
+
+
+*** User Keywords ***
+
+Given no users exist in the system
+   Clear Database
+
+Then message "${msg}" is shown
+    Status Should Be  ${msg}
+
+Then error message "${msg}" is shown
+    Status Should Be  ${msg}
+
+Employee ${name} is added with start date ${date}
+    Add Employee  ${name}  ${date}
+
+User queries info about ${name}
+    Get Employee  ${name}
+

Reply via email to