mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 02:25:40 +00:00
Added Java-Cucumber
This commit is contained in:
1 parent
c260410064
commit
6891e5f993
14 files changed
+506
No files matched your search
@@ -0,0 +1,2 @@
|
||||
cucumber.publish.quiet=true
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
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 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);
|
||||
app = new GildedRose(items);
|
||||
}
|
||||
|
||||
@When("I update the quality")
|
||||
public void i_update_the_quality() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +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
|
||||
When I update the quality
|
||||
Then I should get sellin as 19 and quality as -1
|
||||
@@ -0,0 +1 @@
|
||||
cucumber.publish.quiet=true
|
||||
Reference in new issue
Block a user