Make dotnet-help.Tests pass on localized setup

This commit is contained in:
Nick Guerrera 2017-06-13 19:24:30 -07:00
parent 6e0cfa7839
commit 419562ba95
5 changed files with 29 additions and 5 deletions

View file

@ -25,6 +25,16 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
return new AndConstraint<StringAssertions>(assertions);
}
public static AndConstraint<StringAssertions> BeVisuallyEquivalentToIfNotLocalized(this StringAssertions assertions, string expected, string because = "", params object[] becauseArgs)
{
if (!DotnetUnderTest.IsLocalized())
{
return BeVisuallyEquivalentTo(assertions, expected, because, becauseArgs);
}
return new AndConstraint<StringAssertions>(assertions);
}
public static AndConstraint<StringAssertions> ContainVisuallySameFragment(this StringAssertions assertions, string expected, string because = "", params object[] becauseArgs)
{
Execute.Assertion
@ -34,5 +44,15 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
return new AndConstraint<StringAssertions>(assertions);
}
public static AndConstraint<StringAssertions> ContainVisuallySameFragmentIfNotLocalized(this StringAssertions assertions, string expected, string because = "", params object[] becauseArgs)
{
if (!DotnetUnderTest.IsLocalized())
{
return ContainVisuallySameFragment(assertions, expected, because, becauseArgs);
}
return new AndConstraint<StringAssertions>(assertions);
}
}
}