mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 10:33:53 +00:00
move approvals version of Java to own folder, provide alternative starting point and documentation
This commit is contained in:
1 parent
3f23301beb
commit
68211523d1
17 files changed
+512
-34
No files matched your search
@@ -0,0 +1,38 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user