CharacterOutput { public String getOutput(String message) { if (!writeOutput) { return ""; } generateOutput(message.toCharArray()); return outputStringBuilder.toString(); } CharacterOutput(PluginParameters pluginParameters); String getOutput(String message); boolean isWriteOutput();  }
@Test public void noDebugShouldReturnZeroString() { CharacterOutput characterOutput = new CharacterOutput(new PluginParametersBuilder().setDebug(false).createPluginParameters()); assertEquals("", characterOutput.getOutput("")); }
@Test public void emptyStringShouldBeEmptyBrackets() { CharacterOutput characterOutput = new CharacterOutput(new PluginParametersBuilder().setDebug(true).createPluginParameters()); assertEquals("[]", characterOutput.getOutput("")); }
@Test public void specialCharactersShouldBeOutput() { PluginParameters pluginParameters = new PluginParametersBuilder().setDebug(true).createPluginParameters(); CharacterOutput characterOutput = new CharacterOutput(pluginParameters); assertThat(characterOutput.getOutput("\u00f6\u00e4\u00e5\u00d6\u00c4\u00c5"), is("[['ö' , 246 ],['ä' , 228 ],['å' , 229 ],['Ö' , 214 ],['Ä' , 196 ],['Å' , 197 ]]")); }