0
我用黃瓜進行BDD和一個功能有這種類型的數據表,我怎麼能在黃瓜生成的方法區分哪個類應該用於黃瓜的DataTable有兩種不同類型的
And the following set of "Toys"
| name |something1|
| plane | 400 |
| ball | 800 |
And the following set of "Shoes"
| name | something2|
| boots | 35 |
| sandals | 35 |
此實現拋出異常無法將錶轉換爲java.util.List。當使用列表時,SomeComplexType一定不能是通用類型
@Given("^the following set of \"([^\"]*)\"$")
public <T> void the_following_set_of(String type, List<T> info) throws Throwable {
switch (type) {
case "Toys":
break;
case "Shoes":
break;
default:
break;
}
}
還有其他建議嗎?