mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-12 12:22:12 +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;
|
||||
|
||||
public class StepDefinitions {
|
||||
private String savedName;
|
||||
private Item[] items = new Item[1];
|
||||
private GildedRose app;
|
||||
|
||||
@Given("for {string} initial sellin is {int} and quality is {int}")
|
||||
public void initial_sellin_is_and_quality_is(String name, int sellin, int quality) {
|
||||
savedName = name;
|
||||
items[0] = new Item(name, sellin, quality);
|
||||
@Given("The item as {string}")
|
||||
public void initial_sellin_is_and_quality_is(String name) {
|
||||
items[0] = new Item(name, 0, 0);
|
||||
app = new GildedRose(items);
|
||||
}
|
||||
|
||||
@ -23,11 +21,9 @@ public class StepDefinitions {
|
||||
app.updateQuality();
|
||||
}
|
||||
|
||||
@Then("I should get sellin as {int} and quality as {int}")
|
||||
public void i_should_get_sellin_as_and_quality_as(int sellin, int quality) {
|
||||
assertEquals(savedName, app.items[0].name);
|
||||
assertEquals(sellin, app.items[0].sellIn);
|
||||
assertEquals(quality, app.items[0].quality);
|
||||
@Then("I should get item as {string}")
|
||||
public void i_should_get_sellin_as_and_quality_as(String expected) {
|
||||
assertEquals(expected, app.items[0].name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
Feature: Gilded Rose quality
|
||||
I want to know if the quality is updated properly
|
||||
|
||||
Scenario: Sellin and Quality decreasing
|
||||
Given for "+5 Dexterity Vest" initial sellin is 20 and quality is 30
|
||||
Scenario: Checking foo
|
||||
Given The item as "fixme"
|
||||
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