Fix the given-when-then tests to have public methods.

This commit is contained in:
2023-10-17 22:20:51 +03:00
parent e6de1bde03
commit 7ac264e5e8
2 changed files with 9 additions and 9 deletions
@@ -17,34 +17,34 @@ public class SimpleGivenGivenWhenWhenThenThenTest extends Test {
private int resultCB;
@Given("Create the Sum object")
void setup() {
public void setup() {
sum = new Sum();
}
@Given("Setup the arguments")
void setupArgs() {
public void setupArgs() {
a = 10;
b = 20;
c = 30;
}
@When("Call the .sum(10, 20)")
void triggerAB() {
public void triggerAB() {
resultAB = sum.sum(a, b);
}
@When("Call the .sum(30, 20)")
void triggerCB() {
public void triggerCB() {
resultCB = sum.sum(c, b);
}
@Then("10 + 20 is 30")
void checkAB() {
public void checkAB() {
assert 30 == resultAB;
}
@Then("30 + 20 is 50")
void checkCB() {
public void checkCB() {
assert 50 == resultCB;
}
}
@@ -14,18 +14,18 @@ public class SimpleGivenWhenThenTest extends Test {
private int b;
@Given
void setup() {
public void setup() {
sum = new Sum();
}
@When
void trigger() {
public void trigger() {
a = 10;
b = 20;
}
@Then
void check() {
public void check() {
assert 30 == sum.sum(a, b);
}
}