@Test public void canExtractTwoSymbolsFromLine() throws Exception { String xSymbol = ""; xSymbol += "xxx\n"; xSymbol += "xxx\n"; xSymbol += "xxx\n"; String ySymbol = ""; ySymbol += "yyy\n"; ySymbol += "yyy\n"; ySymbol += "yyy\n"; String symbols = ""; symbols += "xxxyyy\n"; symbols += "xxxyyy\n"; symbols += "xxxyyy\n"; when(symbolReader.nextLine()).thenReturn(symbols); List<String> expectedSymbols = new ArrayList<>(); expectedSymbols.add(xSymbol); expectedSymbols.add(ySymbol); assertEquals(expectedSymbols, symbolExtractor.extractNextLine()); }
@Test public void canExtractOneSymbolFromLine() throws Exception { String symbol = ""; symbol += "xxx\n"; symbol += "xxx\n"; symbol += "xxx\n"; when(symbolReader.nextLine()).thenReturn(symbol); List<String> expectedSymbols = asList(symbol); assertEquals(expectedSymbols, symbolExtractor.extractNextLine()); }