mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 20:32:15 +00:00
Simplified the scaffolding
This commit is contained in:
parent
452a67ca2e
commit
11a5938e49
@ -7,14 +7,12 @@ import io.cucumber.java.en.Then;
|
|||||||
import io.cucumber.java.en.When;
|
import io.cucumber.java.en.When;
|
||||||
|
|
||||||
public class StepDefinitions {
|
public class StepDefinitions {
|
||||||
private String savedName;
|
|
||||||
private Item[] items = new Item[1];
|
private Item[] items = new Item[1];
|
||||||
private GildedRose app;
|
private GildedRose app;
|
||||||
|
|
||||||
@Given("for {string} initial sellin is {int} and quality is {int}")
|
@Given("The item as {string}")
|
||||||
public void initial_sellin_is_and_quality_is(String name, int sellin, int quality) {
|
public void initial_sellin_is_and_quality_is(String name) {
|
||||||
savedName = name;
|
items[0] = new Item(name, 0, 0);
|
||||||
items[0] = new Item(name, sellin, quality);
|
|
||||||
app = new GildedRose(items);
|
app = new GildedRose(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,11 +21,9 @@ public class StepDefinitions {
|
|||||||
app.updateQuality();
|
app.updateQuality();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Then("I should get sellin as {int} and quality as {int}")
|
@Then("I should get item as {string}")
|
||||||
public void i_should_get_sellin_as_and_quality_as(int sellin, int quality) {
|
public void i_should_get_sellin_as_and_quality_as(String expected) {
|
||||||
assertEquals(savedName, app.items[0].name);
|
assertEquals(expected, app.items[0].name);
|
||||||
assertEquals(sellin, app.items[0].sellIn);
|
|
||||||
assertEquals(quality, app.items[0].quality);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
Feature: Gilded Rose quality
|
Feature: Gilded Rose quality
|
||||||
I want to know if the quality is updated properly
|
I want to know if the quality is updated properly
|
||||||
|
|
||||||
Scenario: Sellin and Quality decreasing
|
Scenario: Checking foo
|
||||||
Given for "+5 Dexterity Vest" initial sellin is 20 and quality is 30
|
Given The item as "fixme"
|
||||||
When I update the quality
|
When I update the quality
|
||||||
Then I should get sellin as 19 and quality as 29
|
Then I should get item as "foo"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user