Last active
August 12, 2018 08:02
-
-
Save maaretp/2ec5eb9e38b9d9b1758f98e0bdb016ed to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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