From 62c3798679fcfbee49b88b31235f85d3480da446 Mon Sep 17 00:00:00 2001 From: Nick Guerrera Date: Mon, 19 Jun 2017 11:54:42 -0700 Subject: [PATCH] Use fluent helper for line-end normalization --- ...nThatTheUserIsRunningDotNetForTheFirstTime.cs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs b/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs index 0a7aacf5f..f69b1ce8b 100644 --- a/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs +++ b/test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs @@ -61,13 +61,10 @@ namespace Microsoft.DotNet.Tests [Fact] public void ItShowsTheAppropriateMessageToTheUser() { - string firstTimeUseWelcomeMessage = NormalizeLineEndings(Configurer.LocalizableStrings.FirstTimeWelcomeMessage); - // normalizing line endings as what is used in the resources may - // does not necessarily match how the command stdout capturing logic - // handles newlines. - NormalizeLineEndings(_firstDotnetVerbUseCommandResult.StdOut) - .Should().Contain(firstTimeUseWelcomeMessage) - .And.NotContain("Restore completed in"); + _firstDotnetVerbUseCommandResult.StdOut + .Should() + .ContainVisuallySameFragment(Configurer.LocalizableStrings.FirstTimeWelcomeMessage) + .And.NotContain("Restore completed in"); } [Fact] @@ -112,10 +109,5 @@ namespace Microsoft.DotNet.Tests return new DotnetCommand().ExecuteWithCapturedOutput("--version").StdOut .TrimEnd(Environment.NewLine.ToCharArray()); } - - private static string NormalizeLineEndings(string s) - { - return s.Replace("\r\n", "\n").Replace("\r", "\n"); - } } }