From f9ce5bc529295696c841afc7c17c5b61083a8082 Mon Sep 17 00:00:00 2001 From: mo Date: Tue, 18 Jun 2019 16:44:53 -0600 Subject: try to create a testable API using constructor injection --- src/Q4/RandomSumGameTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Q4/RandomSumGameTest.java') diff --git a/src/Q4/RandomSumGameTest.java b/src/Q4/RandomSumGameTest.java index 3a5e26c..41c0923 100644 --- a/src/Q4/RandomSumGameTest.java +++ b/src/Q4/RandomSumGameTest.java @@ -1,6 +1,7 @@ package ca.mokhan.test; import Q4.*; +import java.io.*; import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; @@ -10,7 +11,7 @@ public class RandomSumGameTest extends TestCase { public RandomSumGameTest(String testName) { super(testName); - this.subject = new RandomSumGame(); + this.subject = new RandomSumGame(new PrintStream(new ByteArrayOutputStream())); } public static Test suite() { -- cgit v1.2.3