Skip to content

Commit

Permalink
[Port] Fixing the code to preserve newline for adapter logs to stdout (
Browse files Browse the repository at this point in the history
…#1999) (#2000)

* Fixing the code to preserve newline for adapter logs to stdout (#1999)
* Bumping the version
  • Loading branch information
singhsarab committed Apr 30, 2019
1 parent a0d7a1b commit c9769b6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion scripts/build/TestPlatform.Settings.targets
Expand Up @@ -2,7 +2,7 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<TestPlatformRoot Condition="$(TestPlatformRoot) == ''">$(MSBuildThisFileDirectory)../../</TestPlatformRoot>
<TPVersionPrefix>15.9.1</TPVersionPrefix>
<TPVersionPrefix>15.9.2</TPVersionPrefix>
</PropertyGroup>
<PropertyGroup>
<!-- Versioning is defined from the build script. Use a default dev build if it's not defined.
Expand Down
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

0 comments on commit c9769b6

Please sign in to comment.