mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-06-15 13:21:00 +00:00
30 lines
732 B
Java
30 lines
732 B
Java
package com.gildedrose;
|
|
|
|
import static org.junit.Assert.*;
|
|
|
|
import io.cucumber.java.en.Given;
|
|
import io.cucumber.java.en.Then;
|
|
import io.cucumber.java.en.When;
|
|
|
|
public class StepDefinitions {
|
|
private Item[] items = new Item[1];
|
|
private GildedRose app;
|
|
|
|
@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);
|
|
}
|
|
|
|
@When("I update the quality")
|
|
public void i_update_the_quality() {
|
|
app.updateQuality();
|
|
}
|
|
|
|
@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);
|
|
}
|
|
}
|
|
|