Skip to content

Instantly share code, notes, and snippets.

@maaretp
Last active August 12, 2018 08:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maaretp/2ec5eb9e38b9d9b1758f98e0bdb016ed to your computer and use it in GitHub Desktop.
Save maaretp/2ec5eb9e38b9d9b1758f98e0bdb016ed to your computer and use it in GitHub Desktop.
package com.gildedrose;
import org.approvaltests.combinations.CombinationApprovals;
import org.approvaltests.legacycode.Range;
import junit.framework.TestCase;
public class GildedRoseApprovalTest extends TestCase {
public void testSomething() throws Exception {
String[] items = { "Foo", "Aged Brie", "Backstage passes to a TAFKAL80ETC concert",
"Sulfuras, Hand of Ragnaros" };
Integer[] sellins = Range.get(-1, 100);
Integer[] qualities = Range.get(-1, 100);
CombinationApprovals.verifyAllCombinations(this::checkItem, items, sellins, qualities);
}
public Item checkItem(String item, Integer sellin, Integer quality) {
Item[] items = new Item[] { new Item(item, sellin, quality) };
GildedRose app = new GildedRose(items);
app.updateQuality();
return items[0];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment