Use fluent helper for line-end normalization
This commit is contained in:
parent
11967b7d9c
commit
62c3798679
1 changed files with 4 additions and 12 deletions
|
@ -61,13 +61,10 @@ namespace Microsoft.DotNet.Tests
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ItShowsTheAppropriateMessageToTheUser()
|
public void ItShowsTheAppropriateMessageToTheUser()
|
||||||
{
|
{
|
||||||
string firstTimeUseWelcomeMessage = NormalizeLineEndings(Configurer.LocalizableStrings.FirstTimeWelcomeMessage);
|
_firstDotnetVerbUseCommandResult.StdOut
|
||||||
// normalizing line endings as what is used in the resources may
|
.Should()
|
||||||
// does not necessarily match how the command stdout capturing logic
|
.ContainVisuallySameFragment(Configurer.LocalizableStrings.FirstTimeWelcomeMessage)
|
||||||
// handles newlines.
|
.And.NotContain("Restore completed in");
|
||||||
NormalizeLineEndings(_firstDotnetVerbUseCommandResult.StdOut)
|
|
||||||
.Should().Contain(firstTimeUseWelcomeMessage)
|
|
||||||
.And.NotContain("Restore completed in");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[Fact]
|
[Fact]
|
||||||
|
@ -112,10 +109,5 @@ namespace Microsoft.DotNet.Tests
|
||||||
return new DotnetCommand().ExecuteWithCapturedOutput("--version").StdOut
|
return new DotnetCommand().ExecuteWithCapturedOutput("--version").StdOut
|
||||||
.TrimEnd(Environment.NewLine.ToCharArray());
|
.TrimEnd(Environment.NewLine.ToCharArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string NormalizeLineEndings(string s)
|
|
||||||
{
|
|
||||||
return s.Replace("\r\n", "\n").Replace("\r", "\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue