From faa7a7e47c5601808769ffe67f79f97cd01dcadc Mon Sep 17 00:00:00 2001 From: Peter Huene Date: Mon, 30 Apr 2018 21:49:02 -0700 Subject: [PATCH] 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. --- .../dotnet.Tests/CommandTests/ToolInstallCommandTests.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs b/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs index 9d52af4d8..6a72ee47a 100644 --- a/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs +++ b/test/dotnet.Tests/CommandTests/ToolInstallCommandTests.cs @@ -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().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(); }