|
@@ -9,29 +9,6 @@ import java.util.*;
|
9
|
9
|
|
10
|
10
|
public class ConsoleTest {
|
11
|
11
|
|
12
|
|
- @Test
|
13
|
|
- public void testCreateAccont()
|
14
|
|
- {
|
15
|
|
- Console console = new Console();
|
16
|
|
- String name = "Jon \n";
|
17
|
|
- Integer balance = 100;
|
18
|
|
- ByteBuffer b = ByteBuffer.allocate(balance);
|
19
|
|
- byte[] result = b.array();
|
20
|
12
|
|
21
|
13
|
|
22
|
|
- byte[] one = result;
|
23
|
|
- byte[] two = name.getBytes();
|
24
|
|
- byte[] combined = new byte[one.length + two.length];
|
25
|
|
-
|
26
|
|
- System.arraycopy(one,0,combined,0,one.length);
|
27
|
|
- System.arraycopy(two,0,combined,one.length,two.length);
|
28
|
|
-
|
29
|
|
-
|
30
|
|
- String data = "Jon" + "\nA second line of user input.";
|
31
|
|
- System.setIn(new ByteArrayInputStream(combined));
|
32
|
|
-
|
33
|
|
- console.setScanner(new Scanner(new ByteArrayInputStream(combined)));
|
34
|
|
-
|
35
|
|
- }
|
36
|
|
-
|
37
|
14
|
}
|