Fix tool package unit test to use the correct resource string.

The `GivenFailedPackageInstallWhenRunWithPackageIdItShouldFail` test should
match against `ToolInstallationFailedWithRestoreGuidance` and not
`ToolInstallationFailed`.  This passed prior to the LOC update because
the former started with the latter and a "contains" match was being performed.
This commit is contained in:
Peter Huene 2018-04-30 21:49:02 -07:00
parent 47a65f258a
commit faa7a7e47c
No known key found for this signature in database
GPG key ID: E1D265D820213D6A

View file

@ -175,9 +175,11 @@ namespace Microsoft.DotNet.Tests.Commands
[Fact]
public void GivenFailedPackageInstallWhenRunWithPackageIdItShouldFail()
{
const string ErrorMessage = "Simulated error";
var toolPackageInstaller =
CreateToolPackageInstaller(
installCallback: () => throw new ToolPackageException("Simulated error"));
installCallback: () => throw new ToolPackageException(ErrorMessage));
var installCommand = new ToolInstallCommand(
_appliedCommand,
@ -191,8 +193,9 @@ namespace Microsoft.DotNet.Tests.Commands
a.ShouldThrow<GracefulException>().And.Message
.Should().Contain(
"Simulated error" + Environment.NewLine
+ string.Format(LocalizableStrings.ToolInstallationFailed, PackageId));
ErrorMessage +
Environment.NewLine +
string.Format(LocalizableStrings.ToolInstallationFailedWithRestoreGuidance, PackageId));
_fileSystem.Directory.Exists(Path.Combine(PathToPlacePackages, PackageId)).Should().BeFalse();
}