Fix failing Cache tests

This commit is contained in:
Piotr Puszkiewicz 2017-03-09 17:20:00 -08:00
parent 03544ad0cd
commit bbc23af138
3 changed files with 8 additions and 8 deletions

View file

@ -11,7 +11,7 @@ namespace Microsoft.DotNet.Cli
{
public static Command Cache() =>
Create.Command(
LocalizableStrings.AppFullName,
"cache",
LocalizableStrings.AppDescription,
Accept.ZeroOrMoreArguments,
CommonOptions.HelpOption(),
@ -37,7 +37,7 @@ namespace Microsoft.DotNet.Cli
.With(name: LocalizableStrings.OutputOption)
.ForwardAs(o => $"/p:ComposeDir={o.Arguments.Single()}")),
Create.Option(
"-w |--working-dir",
"-w|--working-dir",
LocalizableStrings.IntermediateWorkingDirOptionDescription,
Accept.ExactlyOneArgument
.With(name: LocalizableStrings.IntermediateWorkingDirOption)

View file

@ -36,11 +36,11 @@ namespace Microsoft.DotNet.Tools.Cache
var appliedBuildOptions = result["dotnet"]["cache"];
if (!result.HasOption("-e"))
if (!appliedBuildOptions.HasOption("-e"))
{
throw new InvalidOperationException(LocalizableStrings.SpecifyEntries);
}
msbuildArgs.Add("/t:ComposeCache");
msbuildArgs.AddRange(appliedBuildOptions.OptionValuesToBeForwarded());

View file

@ -27,10 +27,10 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
}
[Theory]
[InlineData(new string[] { "-f", "<framework>" }, @"/p:TargetFramework=<framework>")]
[InlineData(new string[] { "--framework", "<framework>" }, @"/p:TargetFramework=<framework>")]
[InlineData(new string[] { "-r", "<runtime>" }, @"/p:RuntimeIdentifier=<runtime>")]
[InlineData(new string[] { "--runtime", "<runtime>" }, @"/p:RuntimeIdentifier=<runtime>")]
[InlineData(new string[] { "-f", "<tfm>" }, @"/p:TargetFramework=<tfm>")]
[InlineData(new string[] { "--framework", "<tfm>" }, @"/p:TargetFramework=<tfm>")]
[InlineData(new string[] { "-r", "<rid>" }, @"/p:RuntimeIdentifier=<rid>")]
[InlineData(new string[] { "--runtime", "<rid>" }, @"/p:RuntimeIdentifier=<rid>")]
public void MsbuildInvocationIsCorrect(string[] args, string expectedAdditionalArgs)
{
args = ArgsPrefix.Concat(args).ToArray();