Skip to content
This repository was archived by the owner on Apr 20, 2023. It is now read-only.

Commit 62c3798

Browse files
committed
Use fluent helper for line-end normalization
1 parent 11967b7 commit 62c3798

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

test/dotnet.Tests/GivenThatTheUserIsRunningDotNetForTheFirstTime.cs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,10 @@ public void UsingDotnetForTheFirstTimeWithNonVerbsDoesNotPrintEula()
6161
[Fact]
6262
public void ItShowsTheAppropriateMessageToTheUser()
6363
{
64-
string firstTimeUseWelcomeMessage = NormalizeLineEndings(Configurer.LocalizableStrings.FirstTimeWelcomeMessage);
65-
// normalizing line endings as what is used in the resources may
66-
// does not necessarily match how the command stdout capturing logic
67-
// handles newlines.
68-
NormalizeLineEndings(_firstDotnetVerbUseCommandResult.StdOut)
69-
.Should().Contain(firstTimeUseWelcomeMessage)
70-
.And.NotContain("Restore completed in");
64+
_firstDotnetVerbUseCommandResult.StdOut
65+
.Should()
66+
.ContainVisuallySameFragment(Configurer.LocalizableStrings.FirstTimeWelcomeMessage)
67+
.And.NotContain("Restore completed in");
7168
}
7269

7370
[Fact]
@@ -112,10 +109,5 @@ private string GetDotnetVersion()
112109
return new DotnetCommand().ExecuteWithCapturedOutput("--version").StdOut
113110
.TrimEnd(Environment.NewLine.ToCharArray());
114111
}
115-
116-
private static string NormalizeLineEndings(string s)
117-
{
118-
return s.Replace("\r\n", "\n").Replace("\r", "\n");
119-
}
120112
}
121113
}

0 commit comments

Comments
 (0)