mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-15 18:43:53 +00:00
approval tests for java analog to csharp variant
This commit is contained in:
1 parent
263a07d58d
commit
3f23301beb
3 files changed
+65
No files matched your search
@@ -0,0 +1,28 @@
|
||||
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;
|
||||
|
||||
@UseReporter(DiffReporter.class)
|
||||
public class ApprovalTest {
|
||||
|
||||
@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