Index: Migration/Console/src/Migration.Console/ConsoleHelper.cs =================================================================== diff -u -r215a141e7d6904d36aa00b662a2d3853c7c208b2 -rac9fc776779eb7f111ca7d9911d4684d47818891 --- Migration/Console/src/Migration.Console/ConsoleHelper.cs (.../ConsoleHelper.cs) (revision 215a141e7d6904d36aa00b662a2d3853c7c208b2) +++ Migration/Console/src/Migration.Console/ConsoleHelper.cs (.../ConsoleHelper.cs) (revision ac9fc776779eb7f111ca7d9911d4684d47818891) @@ -53,29 +53,5 @@ SystemConsole.WriteLine(format, args); SystemConsole.ResetColor(); } - - /// - /// Writes as an info text to the . - /// - /// A composite format string. - /// An array of objects to write using . - /// Thrown when any of the input parameters is null. - /// Thrown when an I/O error occurred. - /// Thrown when the format specification in is invalid. - /// - public static void WriteInfoLine(string format, params object[] args) - { - if (format == null) - { - throw new ArgumentNullException(nameof(format)); - } - if (args == null) - { - throw new ArgumentNullException(nameof(args)); - } - SystemConsole.ForegroundColor = ConsoleColor.White; - SystemConsole.WriteLine(format, args); - SystemConsole.ResetColor(); - } } } \ No newline at end of file Index: Migration/Console/src/Migration.Console/RingtoetsMigrationTool.cs =================================================================== diff -u -rdb555a35f4ca5c9bb274d0842d1cce5dab6c34ee -rac9fc776779eb7f111ca7d9911d4684d47818891 --- Migration/Console/src/Migration.Console/RingtoetsMigrationTool.cs (.../RingtoetsMigrationTool.cs) (revision db555a35f4ca5c9bb274d0842d1cce5dab6c34ee) +++ Migration/Console/src/Migration.Console/RingtoetsMigrationTool.cs (.../RingtoetsMigrationTool.cs) (revision ac9fc776779eb7f111ca7d9911d4684d47818891) @@ -98,9 +98,9 @@ private static void DisplayAllCommands() { - ConsoleHelper.WriteInfoLine(commandHelp - + "\t" - + Resources.CommandHelp_Command_0_Detailed, commandHelp); + SystemConsole.WriteLine(commandHelp + + "\t" + + Resources.CommandHelp_Command_0_Detailed, commandHelp); ShowMigrateCommand(); ShowSupportedCommand(); } @@ -135,9 +135,9 @@ private static void ShowSupportedCommand() { - ConsoleHelper.WriteInfoLine(Resources.CommandSupported_Command_0_Brief - + "\t" - + Resources.CommandSupported_Detailed, commandVersionSupported); + SystemConsole.WriteLine(Resources.CommandSupported_Command_0_Brief + + "\t" + + Resources.CommandSupported_Detailed, commandVersionSupported); } #endregion @@ -164,9 +164,9 @@ private static void ShowMigrateCommand() { - ConsoleHelper.WriteInfoLine(Resources.CommandMigrate_Command_0_Brief - + "\t" - + Resources.CommandMigrate_Detailed, commandMigrate); + SystemConsole.WriteLine(Resources.CommandMigrate_Command_0_Brief + + "\t" + + Resources.CommandMigrate_Detailed, commandMigrate); } #endregion Index: Migration/Console/test/Migration.Console.Test/ConsoleHelperTest.cs =================================================================== diff -u -r215a141e7d6904d36aa00b662a2d3853c7c208b2 -rac9fc776779eb7f111ca7d9911d4684d47818891 --- Migration/Console/test/Migration.Console.Test/ConsoleHelperTest.cs (.../ConsoleHelperTest.cs) (revision 215a141e7d6904d36aa00b662a2d3853c7c208b2) +++ Migration/Console/test/Migration.Console.Test/ConsoleHelperTest.cs (.../ConsoleHelperTest.cs) (revision ac9fc776779eb7f111ca7d9911d4684d47818891) @@ -120,91 +120,5 @@ // Assert Assert.Throws(call); } - - [Test] - public void WriteInfoLine_StringNull_ThrowsArgumentNullException() - { - // Setup - var originalColor = SystemConsole.ForegroundColor; - const string args = "an argument"; - - // Call - TestDelegate call = () => ConsoleHelper.WriteInfoLine(null, args); - - // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("format", paramName); - Assert.AreEqual(originalColor, SystemConsole.ForegroundColor); - } - - [Test] - public void WriteInfoLine_ArgsNull_ThrowsArgumentNullException() - { - // Setup - var originalColor = SystemConsole.ForegroundColor; - const string writeLine = "this is an info line with {0}"; - - // Call - TestDelegate call = () => ConsoleHelper.WriteErrorLine(writeLine, null); - - // Assert - string paramName = Assert.Throws(call).ParamName; - Assert.AreEqual("args", paramName); - Assert.AreEqual(originalColor, SystemConsole.ForegroundColor); - } - - [Test] - public void WriteInfoLine_StringAndParamArgs_WritesExpectedLine() - { - // Setup - var originalColor = SystemConsole.ForegroundColor; - const string writeLine = "this is an info line with {0}"; - const string args = "an argument"; - string consoleText; - - // Call - using (var consoleOutput = new ConsoleOutput()) - { - ConsoleHelper.WriteInfoLine(writeLine, args); - consoleText = consoleOutput.GetConsoleOutput(); - } - - // Assert - Assert.AreEqual(string.Format(writeLine, args) + Environment.NewLine, consoleText); - Assert.AreEqual(originalColor, SystemConsole.ForegroundColor); - } - - [Test] - public void WriteInfoLine_String_WritesExpectedLine() - { - // Setup - var originalColor = SystemConsole.ForegroundColor; - const string writeLine = "this is an info line"; - string consoleText; - - // Call - using (var consoleOutput = new ConsoleOutput()) - { - ConsoleHelper.WriteInfoLine(writeLine); - consoleText = consoleOutput.GetConsoleOutput(); - } - - // Assert - Assert.AreEqual(writeLine + Environment.NewLine, consoleText); - Assert.AreEqual(originalColor, SystemConsole.ForegroundColor); - } - - [Test] - public void WriteInfoLine_InvalidString_ThrowsFormatException() - { - // Setup - string invalidFormat = "{d}"; - - // Call - TestDelegate call = () => ConsoleHelper.WriteInfoLine(invalidFormat, "ABC"); - - // Assert - Assert.Throws(call); - } } } \ No newline at end of file