I am new to BDD and Specflow and want to test the following scenarios.
Before I can Test I have to create some data in the database.
- Application User
- NursingHome where I need a reference to the Application User
- Employee where I need a reference to the NursingHome
Then I add a job (from, to) to the employee. When I add a second job some tests should be executed.
Here is my first feature file attempt:
Feature: US01_AddEmploymentStatus
It is not allowed that a employee has two jobs at the same time.
A job can be closed.
If a employee gets another job the old one is closed.
Background:
Given the following application user
| FirstName | LastName | UserName | Password |
| Application | User | ApplicationUser | password |
Given the following NursingHome
| Name | Street | PostalCode | City |
| TestHome | Bahnhofstrasse 1 | 9020 | Klagenfurt |
Given the following employee
| FirstName | LastName |
| Max | Mustermann |
Scenario: Employee changes his job.
Given Max Mustermann has following job
| From | To | State | QualificationId | NursingHomeId |
| 01.01.2010 | null | 1 | 1 | ? |
And he get a new position
| From | To | State | QualificationId | NursingHomeId |
| 01.01.2014 | null | 1 | 2 | ? |
When I add the new postion
Then the old one should be closed
How can I handle the references?