Skip to content

Commit

Permalink
Fixing the code to preserve newline for adapter logs to stdout (#1999)
Browse files Browse the repository at this point in the history
  • Loading branch information
singhsarab authored Apr 26, 2019
1 parent 50b7581 commit 0d85a87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ private void InitializeInternal()
/// </param>
private void AddRunLevelInformationalMessage(string message)
{
this.runLevelStdOut.Append(message);
this.runLevelStdOut.AppendLine(message);
}

// Handle the skipped test result
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,16 @@ public void TestMessageHandlerShouldThrowExceptionIfEventArgsIsNull()
[TestMethod]
public void TestMessageHandlerShouldAddMessageWhenItIsInformation()
{
string message = "The information to test";
string message = "First message";
string message2 = "Second message";
TestRunMessageEventArgs trme = new TestRunMessageEventArgs(TestMessageLevel.Informational, message);
this.testableTrxLogger.TestMessageHandler(new object(), trme);

Assert.IsTrue(this.testableTrxLogger.GetRunLevelInformationalMessage().Contains(message));
TestRunMessageEventArgs trme2 = new TestRunMessageEventArgs(TestMessageLevel.Informational, message2);
this.testableTrxLogger.TestMessageHandler(new object(), trme2);

string expectedMessage = message + Environment.NewLine + message2 + Environment.NewLine;
Assert.AreEqual(expectedMessage, this.testableTrxLogger.GetRunLevelInformationalMessage());
}

[TestMethod]
Expand Down Expand Up @@ -234,7 +239,7 @@ public void TestResultHandlerLockingAMessageForSkipTest()

string expectedMessage = String.Format(CultureInfo.CurrentCulture, TrxLoggerResources.MessageForSkippedTests, "Skip1");

Assert.AreEqual(String.Compare(this.testableTrxLogger.GetRunLevelInformationalMessage(), expectedMessage, true), 0);
Assert.AreEqual(expectedMessage + Environment.NewLine, this.testableTrxLogger.GetRunLevelInformationalMessage());
}

[TestMethod]
Expand Down

0 comments on commit 0d85a87

Please sign in to comment.