FileWriterApplicationConsole implements ApplicationConsole { @Override public boolean isDiagnosticsEnabled() { return m_diagnosticMode; } FileWriterApplicationConsole(FileWriter fileWriter);  FileWriterApplicationConsole(String fileName);  FileWriterApplicationConsole(FileWriter fileWriter,
                                        boolean    diagnosticMode); @Override void close(); @Override PrintWriter getOutputWriter(); @Override PrintWriter getErrorWriter(); @Override Reader getInputReader(); @Override boolean isDiagnosticsEnabled(); static ApplicationConsoleBuilder builder(final String directory); static ApplicationConsoleBuilder builder(final String directory,
                                                    final String prefix); static ApplicationConsoleBuilder builder(final String directory,
                                                    final String prefix,
                                                    final String suffix);  }
@Test public void shouldBeDiagnosticModeByDefault() throws Exception { File file = temporaryFolder.newFile(); FileWriterApplicationConsole console1 = new FileWriterApplicationConsole(new FileWriter(file)); FileWriterApplicationConsole console2 = new FileWriterApplicationConsole(file.getCanonicalPath()); assertThat(console1.isDiagnosticsEnabled(), is(true)); assertThat(console2.isDiagnosticsEnabled(), is(true)); }
@Test public void shouldNotBeDiagnosticMode() throws Exception { File file = temporaryFolder.newFile(); FileWriterApplicationConsole console = new FileWriterApplicationConsole(new FileWriter(file), false); assertThat(console.isDiagnosticsEnabled(), is(false)); }
@Test public void shouldBeDiagnosticMode() throws Exception { File file = temporaryFolder.newFile(); FileWriterApplicationConsole console = new FileWriterApplicationConsole(new FileWriter(file), true); assertThat(console.isDiagnosticsEnabled(), is(true)); }