package com.cucumber;
import com.cucumber.action.Calculator;
import cucumber.api.PendingException;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
import static org.junit.Assert.assertEquals;
/**
* Created by Scott on 16/5/11.
*/
public class Add {
Calculator calculator;
@Given("^i input \"([^\"]*)\" and \"([^\"]*)\"$")
public void iInputAnd(String arg0, String arg1) throws Throwable {
// Write code here that turns the phrase above into concrete actions
calculator = new Calculator();
calculator.setNum1(Integer.parseInt(arg0));
calculator.setNum2(Integer.parseInt(arg1));
}
@When("^the calculator is run$")
public void theCalculatorIsRun() throws Throwable {
// Write code here that turns the phrase above into concrete actions
calculator.calculate();
}
@Then("^the out put should be \"([^\"]*)\"$")
public void theOutPutShouldBe(String arg0) throws Throwable {
// Write code here that turns the phrase above into concrete actions
assertEquals(Integer.parseInt(arg0),calculator.getTotle());
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
cucumber.zip (30个子文件)
cucumber
src
test
resources
test.feature 165B
cucumberTest
adding.feature 138B
blog.feature 139B
muiltyNum.feature 324B
java
com
cucumber
Blog.java 882B
MyStepdefs.java 942B
Add.java 1KB
main
resources
java
com
cucumber
action
Calculator.java 542B
target
generated-test-sources
test-annotations
generated-sources
annotations
classes
com
cucumber
action
Calculator.class 865B
test-classes
test.feature 165B
com
cucumber
Blog.class 892B
MyStepdefs.class 1KB
Add.class 1KB
cucumberTest
adding.feature 138B
blog.feature 139B
muiltyNum.feature 309B
.idea
libraries
Maven__info_cukes_cucumber_html_0_2_3.xml 526B
Maven__junit_junit_4_12.xml 443B
Maven__info_cukes_cucumber_jvm_deps_1_0_5.xml 554B
Maven__info_cukes_cucumber_java_1_2_4.xml 526B
Maven__info_cukes_gherkin_2_12_2.xml 491B
Maven__org_hamcrest_hamcrest_core_1_3.xml 520B
Maven__info_cukes_cucumber_core_1_2_4.xml 526B
misc.xml 1KB
compiler.xml 1KB
workspace.xml 57KB
modules.xml 256B
copyright
profiles_settings.xml 74B
pom.xml 1KB
cucumber.iml 2KB
共 30 条
- 1
资源评论
- qq_338657012017-10-17还没有看!
- crystalstart2018-12-11风格不搭 郭德纲
若北冥
- 粉丝: 8
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功