Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Trxlogger] Fixing the code to preserve newline for adapter logs to stdout #1999

Merged
merged 1 commit into from Apr 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
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