【发布时间】:2014-10-14 07:16:24
【问题描述】:
我是 BDD 和 Specflow 的新手,想测试以下场景。
在我可以测试之前,我必须在数据库中创建一些数据。
- 应用用户
- 我需要参考应用程序用户的 NursingHome
- 我需要参考 NursingHome 的员工
然后我向员工添加一个工作(从,到)。当我添加第二个作业时,应该执行一些测试。
这是我第一次尝试功能文件:
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
如何处理引用?
【问题讨论】: