mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2025-12-13 12:52:22 +00:00
39 lines
953 B
Java
39 lines
953 B
Java
package com.gildedrose;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayOutputStream;
|
|
import java.io.PrintStream;
|
|
|
|
import org.approvaltests.Approvals;
|
|
import org.approvaltests.reporters.DiffReporter;
|
|
import org.approvaltests.reporters.UseReporter;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.w3c.dom.Text;
|
|
|
|
@UseReporter(DiffReporter.class)
|
|
public class GildedRoseApprovalTest {
|
|
|
|
@Test
|
|
public void foo() {
|
|
|
|
Item[] items = new Item[] { new Item("foo", 0, 0) };
|
|
GildedRose app = new GildedRose(items);
|
|
app.updateQuality();
|
|
|
|
Approvals.verifyAll("Items", items);
|
|
}
|
|
|
|
@Test
|
|
public void thirtyDays() {
|
|
|
|
ByteArrayOutputStream fakeoutput = new ByteArrayOutputStream();
|
|
System.setOut(new PrintStream(fakeoutput));
|
|
System.setIn(new ByteArrayInputStream("a\n".getBytes()));
|
|
|
|
Program.main();
|
|
String output = fakeoutput.toString();
|
|
|
|
Approvals.verify(output);
|
|
}
|
|
}
|