From e109a9be470936050eff105718d14e0d28fc1fc6 Mon Sep 17 00:00:00 2001 From: Justin Goshi Date: Fri, 6 Jan 2017 10:58:23 -1000 Subject: [PATCH] dotnet sln command (#5233) * Add dotnet sln command * Use new names for localizable strings * Fix up the tests for the verb rename --- src/Microsoft.DotNet.Cli.Utils/Constants.cs | 3 +- src/dotnet/DotNetTopLevelCommandBase.cs | 8 ++-- src/dotnet/Program.cs | 2 + src/dotnet/commands/dotnet-add/Program.cs | 7 +-- src/dotnet/commands/dotnet-list/Program.cs | 5 +- .../commands/dotnet-migrate/MigrateCommand.cs | 4 +- src/dotnet/commands/dotnet-remove/Program.cs | 5 +- src/dotnet/commands/dotnet-sln/Program.cs | 34 +++++++++++++ .../add}/Program.cs | 11 +++-- .../list}/Program.cs | 9 ++-- .../remove}/Program.cs | 11 +++-- .../dotnet-add-p2p.Tests/GivenDotnetAddP2P.cs | 4 +- .../GivenDotnetListP2Ps.cs | 4 +- .../GivenDotnetRemoveP2P.cs | 4 +- .../GivenDotnetSlnAdd.cs} | 46 +++++++++--------- .../MSBuild.exe | 0 .../MSBuild.exe.config | 0 .../dotnet-sln-add.Tests.csproj} | 2 +- .../GivenDotnetSlnList.cs} | 30 ++++++------ .../MSBuild.exe | 0 .../MSBuild.exe.config | 0 .../dotnet-sln-list.Tests.csproj} | 2 +- .../GivenDotnetSlnRemove.cs} | 48 +++++++++---------- .../MSBuild.exe | 0 .../MSBuild.exe.config | 0 .../dotnet-sln-remove.Tests.csproj} | 2 +- 26 files changed, 142 insertions(+), 99 deletions(-) create mode 100644 src/dotnet/commands/dotnet-sln/Program.cs rename src/dotnet/commands/{dotnet-add/dotnet-add-proj => dotnet-sln/add}/Program.cs (96%) rename src/dotnet/commands/{dotnet-list/dotnet-list-proj => dotnet-sln/list}/Program.cs (85%) rename src/dotnet/commands/{dotnet-remove/dotnet-remove-proj => dotnet-sln/remove}/Program.cs (94%) rename test/{dotnet-add-proj.Tests/GivenDotnetAddProj.cs => dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs} (93%) rename test/{dotnet-add-proj.Tests => dotnet-sln-add.Tests}/MSBuild.exe (100%) rename test/{dotnet-add-proj.Tests => dotnet-sln-add.Tests}/MSBuild.exe.config (100%) rename test/{dotnet-add-proj.Tests/dotnet-add-proj.Tests.csproj => dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj} (97%) rename test/{dotnet-list-proj.Tests/GivenDotnetListProj.cs => dotnet-sln-list.Tests/GivenDotnetSlnList.cs} (85%) rename test/{dotnet-list-proj.Tests => dotnet-sln-list.Tests}/MSBuild.exe (100%) rename test/{dotnet-list-proj.Tests => dotnet-sln-list.Tests}/MSBuild.exe.config (100%) rename test/{dotnet-list-proj.Tests/dotnet-list-proj.Tests.csproj => dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj} (96%) rename test/{dotnet-remove-proj.Tests/GivenDotnetRemoveProj.cs => dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs} (91%) rename test/{dotnet-remove-proj.Tests => dotnet-sln-remove.Tests}/MSBuild.exe (100%) rename test/{dotnet-remove-proj.Tests => dotnet-sln-remove.Tests}/MSBuild.exe.config (100%) rename test/{dotnet-remove-proj.Tests/dotnet-remove-proj.Tests.csproj => dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj} (96%) diff --git a/src/Microsoft.DotNet.Cli.Utils/Constants.cs b/src/Microsoft.DotNet.Cli.Utils/Constants.cs index bab2ddcdf..38748f76f 100644 --- a/src/Microsoft.DotNet.Cli.Utils/Constants.cs +++ b/src/Microsoft.DotNet.Cli.Utils/Constants.cs @@ -49,6 +49,7 @@ namespace Microsoft.DotNet.Cli.Utils public static readonly string MSBUILD_EXE_PATH = "MSBUILD_EXE_PATH"; - public static readonly string ProjectOrSolutionArgumentName = ""; + public static readonly string ProjectArgumentName = ""; + public static readonly string SolutionArgumentName = ""; } } diff --git a/src/dotnet/DotNetTopLevelCommandBase.cs b/src/dotnet/DotNetTopLevelCommandBase.cs index 8f547b86f..640d8dccc 100644 --- a/src/dotnet/DotNetTopLevelCommandBase.cs +++ b/src/dotnet/DotNetTopLevelCommandBase.cs @@ -16,6 +16,8 @@ namespace Microsoft.DotNet.Cli { protected abstract string CommandName { get; } protected abstract string FullCommandNameLocalized { get; } + protected abstract string ArgumentName { get; } + protected abstract string ArgumentDescriptionLocalized { get; } internal abstract List> SubCommands { get; } public int RunCommand(string[] args) @@ -30,9 +32,7 @@ namespace Microsoft.DotNet.Cli command.HelpOption("-h|--help"); - command.Argument( - Constants.ProjectOrSolutionArgumentName, - CommonLocalizableStrings.ArgumentsProjectOrSolutionDescription); + command.Argument(ArgumentName, ArgumentDescriptionLocalized); foreach (var subCommandCreator in SubCommands) { @@ -44,7 +44,7 @@ namespace Microsoft.DotNet.Cli { if (!command.Arguments.Any()) { - throw new GracefulException(CommonLocalizableStrings.RequiredArgumentNotPassed, Constants.ProjectOrSolutionArgumentName); + throw new GracefulException(CommonLocalizableStrings.RequiredArgumentNotPassed, ArgumentDescriptionLocalized); } var projectOrDirectory = command.Arguments.First().Value; diff --git a/src/dotnet/Program.cs b/src/dotnet/Program.cs index 28ba9f75e..526209659 100644 --- a/src/dotnet/Program.cs +++ b/src/dotnet/Program.cs @@ -23,6 +23,7 @@ using Microsoft.DotNet.Tools.Remove; using Microsoft.DotNet.Tools.Restore; using Microsoft.DotNet.Tools.RestoreProjectJson; using Microsoft.DotNet.Tools.Run; +using Microsoft.DotNet.Tools.Sln; using Microsoft.DotNet.Tools.Test; using Microsoft.DotNet.Tools.VSTest; using NuGet.Frameworks; @@ -48,6 +49,7 @@ namespace Microsoft.DotNet.Cli ["restore"] = RestoreCommand.Run, ["restore-projectjson"] = RestoreProjectJsonCommand.Run, ["run"] = RunCommand.Run, + ["sln"] = SlnCommand.Run, ["test"] = TestCommand.Run, ["vstest"] = VSTestCommand.Run, }; diff --git a/src/dotnet/commands/dotnet-add/Program.cs b/src/dotnet/commands/dotnet-add/Program.cs index e6a5fc452..6ed977a98 100644 --- a/src/dotnet/commands/dotnet-add/Program.cs +++ b/src/dotnet/commands/dotnet-add/Program.cs @@ -4,9 +4,9 @@ using System; using System.Collections.Generic; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Add.PackageReference; using Microsoft.DotNet.Tools.Add.ProjectToProjectReference; -using Microsoft.DotNet.Tools.Add.ProjectToSolution; namespace Microsoft.DotNet.Tools.Add { @@ -14,12 +14,13 @@ namespace Microsoft.DotNet.Tools.Add { protected override string CommandName => "add"; protected override string FullCommandNameLocalized => LocalizableStrings.NetAddCommand; + protected override string ArgumentName => Constants.ProjectArgumentName; + protected override string ArgumentDescriptionLocalized => CommonLocalizableStrings.ArgumentsProjectDescription; internal override List> SubCommands => new List> { - AddProjectToSolutionCommand.Create, AddProjectToProjectReferenceCommand.Create, - AddPackageReferenceCommand.Create + AddPackageReferenceCommand.Create, }; public static int Run(string[] args) diff --git a/src/dotnet/commands/dotnet-list/Program.cs b/src/dotnet/commands/dotnet-list/Program.cs index 4bd038b08..62cdc3bac 100644 --- a/src/dotnet/commands/dotnet-list/Program.cs +++ b/src/dotnet/commands/dotnet-list/Program.cs @@ -4,8 +4,8 @@ using System; using System.Collections.Generic; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.List.ProjectToProjectReferences; -using Microsoft.DotNet.Tools.List.ProjectsInSolution; namespace Microsoft.DotNet.Tools.List { @@ -13,10 +13,11 @@ namespace Microsoft.DotNet.Tools.List { protected override string CommandName => "list"; protected override string FullCommandNameLocalized => LocalizableStrings.NetListCommand; + protected override string ArgumentName => Constants.ProjectArgumentName; + protected override string ArgumentDescriptionLocalized => CommonLocalizableStrings.ArgumentsProjectDescription; internal override List> SubCommands => new List> { - ListProjectsInSolutionCommand.Create, ListProjectToProjectReferencesCommand.Create, }; diff --git a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs b/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs index 93392816d..a814acd82 100644 --- a/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs +++ b/src/dotnet/commands/dotnet-migrate/MigrateCommand.cs @@ -153,9 +153,9 @@ namespace Microsoft.DotNet.Tools.Migrate { List args = new List() { - "add", + "sln", slnPath, - "project", + "add", csprojPath, }; diff --git a/src/dotnet/commands/dotnet-remove/Program.cs b/src/dotnet/commands/dotnet-remove/Program.cs index a6fc65c53..26555a63b 100644 --- a/src/dotnet/commands/dotnet-remove/Program.cs +++ b/src/dotnet/commands/dotnet-remove/Program.cs @@ -4,8 +4,8 @@ using System; using System.Collections.Generic; using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Remove.PackageReference; -using Microsoft.DotNet.Tools.Remove.ProjectFromSolution; using Microsoft.DotNet.Tools.Remove.ProjectToProjectReference; namespace Microsoft.DotNet.Tools.Remove @@ -14,10 +14,11 @@ namespace Microsoft.DotNet.Tools.Remove { protected override string CommandName => "remove"; protected override string FullCommandNameLocalized => LocalizableStrings.NetRemoveCommand; + protected override string ArgumentName => Constants.ProjectArgumentName; + protected override string ArgumentDescriptionLocalized => CommonLocalizableStrings.ArgumentsProjectDescription; internal override List> SubCommands => new List> { - RemoveProjectFromSolutionCommand.Create, RemoveProjectToProjectReferenceCommand.Create, RemovePackageReferenceCommand.Create }; diff --git a/src/dotnet/commands/dotnet-sln/Program.cs b/src/dotnet/commands/dotnet-sln/Program.cs new file mode 100644 index 000000000..a1e81ad80 --- /dev/null +++ b/src/dotnet/commands/dotnet-sln/Program.cs @@ -0,0 +1,34 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using System; +using System.Collections.Generic; +using Microsoft.DotNet.Cli; +using Microsoft.DotNet.Cli.Utils; +using Microsoft.DotNet.Tools.Sln.Add; +using Microsoft.DotNet.Tools.Sln.List; +using Microsoft.DotNet.Tools.Sln.Remove; + +namespace Microsoft.DotNet.Tools.Sln +{ + public class SlnCommand : DotNetTopLevelCommandBase + { + protected override string CommandName => "sln"; + protected override string FullCommandNameLocalized => LocalizableStrings.AppFullName; + protected override string ArgumentName => Constants.SolutionArgumentName; + protected override string ArgumentDescriptionLocalized => CommonLocalizableStrings.ArgumentsSolutionDescription; + internal override List> SubCommands => + new List> + { + AddProjectToSolutionCommand.Create, + ListProjectsInSolutionCommand.Create, + RemoveProjectFromSolutionCommand.Create + }; + + public static int Run(string[] args) + { + var command = new SlnCommand(); + return command.RunCommand(args); + } + } +} \ No newline at end of file diff --git a/src/dotnet/commands/dotnet-add/dotnet-add-proj/Program.cs b/src/dotnet/commands/dotnet-sln/add/Program.cs similarity index 96% rename from src/dotnet/commands/dotnet-add/dotnet-add-proj/Program.cs rename to src/dotnet/commands/dotnet-sln/add/Program.cs index 07781a1ba..5cb8869ce 100644 --- a/src/dotnet/commands/dotnet-add/dotnet-add-proj/Program.cs +++ b/src/dotnet/commands/dotnet-sln/add/Program.cs @@ -8,12 +8,13 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; +using Microsoft.DotNet.Tools.Sln; using System; using System.Collections.Generic; using System.IO; using System.Linq; -namespace Microsoft.DotNet.Tools.Add.ProjectToSolution +namespace Microsoft.DotNet.Tools.Sln.Add { internal class AddProjectToSolutionCommand : DotNetSubCommandBase { @@ -21,11 +22,11 @@ namespace Microsoft.DotNet.Tools.Add.ProjectToSolution { var command = new AddProjectToSolutionCommand() { - Name = "project", - FullName = LocalizableStrings.AppFullName, - Description = LocalizableStrings.AppDescription, + Name = "add", + FullName = LocalizableStrings.AddAppFullName, + Description = LocalizableStrings.AddSubcommandHelpText, HandleRemainingArguments = true, - ArgumentSeparatorHelpText = LocalizableStrings.AppHelpText, + ArgumentSeparatorHelpText = LocalizableStrings.AddSubcommandHelpText, }; command.HelpOption("-h|--help"); diff --git a/src/dotnet/commands/dotnet-list/dotnet-list-proj/Program.cs b/src/dotnet/commands/dotnet-sln/list/Program.cs similarity index 85% rename from src/dotnet/commands/dotnet-list/dotnet-list-proj/Program.cs rename to src/dotnet/commands/dotnet-sln/list/Program.cs index a8f3a07b0..3ff1f8480 100644 --- a/src/dotnet/commands/dotnet-list/dotnet-list-proj/Program.cs +++ b/src/dotnet/commands/dotnet-sln/list/Program.cs @@ -5,8 +5,9 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; +using Microsoft.DotNet.Tools.Sln; -namespace Microsoft.DotNet.Tools.List.ProjectsInSolution +namespace Microsoft.DotNet.Tools.Sln.List { internal class ListProjectsInSolutionCommand : DotNetSubCommandBase { @@ -14,9 +15,9 @@ namespace Microsoft.DotNet.Tools.List.ProjectsInSolution { var command = new ListProjectsInSolutionCommand() { - Name = "projects", - FullName = LocalizableStrings.AppFullName, - Description = LocalizableStrings.AppDescription, + Name = "list", + FullName = LocalizableStrings.ListAppFullName, + Description = LocalizableStrings.ListSubcommandHelpText, }; command.HelpOption("-h|--help"); diff --git a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/Program.cs b/src/dotnet/commands/dotnet-sln/remove/Program.cs similarity index 94% rename from src/dotnet/commands/dotnet-remove/dotnet-remove-proj/Program.cs rename to src/dotnet/commands/dotnet-sln/remove/Program.cs index 5fca7d695..deb9ea72a 100644 --- a/src/dotnet/commands/dotnet-remove/dotnet-remove-proj/Program.cs +++ b/src/dotnet/commands/dotnet-sln/remove/Program.cs @@ -5,12 +5,13 @@ using Microsoft.DotNet.Cli; using Microsoft.DotNet.Cli.Sln.Internal; using Microsoft.DotNet.Cli.Utils; using Microsoft.DotNet.Tools.Common; +using Microsoft.DotNet.Tools.Sln; using System; using System.Collections.Generic; using System.IO; using System.Linq; -namespace Microsoft.DotNet.Tools.Remove.ProjectFromSolution +namespace Microsoft.DotNet.Tools.Sln.Remove { internal class RemoveProjectFromSolutionCommand : DotNetSubCommandBase { @@ -18,11 +19,11 @@ namespace Microsoft.DotNet.Tools.Remove.ProjectFromSolution { var command = new RemoveProjectFromSolutionCommand() { - Name = "project", - FullName = LocalizableStrings.AppFullName, - Description = LocalizableStrings.AppDescription, + Name = "remove", + FullName = LocalizableStrings.RemoveAppFullName, + Description = LocalizableStrings.RemoveSubcommandHelpText, HandleRemainingArguments = true, - ArgumentSeparatorHelpText = LocalizableStrings.AppHelpText, + ArgumentSeparatorHelpText = LocalizableStrings.RemoveSubcommandHelpText, }; command.HelpOption("-h|--help"); diff --git a/test/dotnet-add-p2p.Tests/GivenDotnetAddP2P.cs b/test/dotnet-add-p2p.Tests/GivenDotnetAddP2P.cs index 864dc3b81..b768f2e10 100644 --- a/test/dotnet-add-p2p.Tests/GivenDotnetAddP2P.cs +++ b/test/dotnet-add-p2p.Tests/GivenDotnetAddP2P.cs @@ -16,10 +16,10 @@ namespace Microsoft.DotNet.Cli.Add.P2P.Tests { private const string HelpText = @".NET Add Project to Project (p2p) reference Command -Usage: dotnet add p2p [options] [args] +Usage: dotnet add p2p [options] [args] Arguments: - The project or solution to operation on. If a file is not specified, the current directory is searched. + The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: -h|--help Show help information diff --git a/test/dotnet-list-p2ps.Tests/GivenDotnetListP2Ps.cs b/test/dotnet-list-p2ps.Tests/GivenDotnetListP2Ps.cs index 75049a8f8..307978fcc 100644 --- a/test/dotnet-list-p2ps.Tests/GivenDotnetListP2Ps.cs +++ b/test/dotnet-list-p2ps.Tests/GivenDotnetListP2Ps.cs @@ -15,10 +15,10 @@ namespace Microsoft.DotNet.Cli.List.P2P.Tests { private const string HelpText = @".NET Core Project-to-Project dependency viewer -Usage: dotnet list p2ps [options] +Usage: dotnet list p2ps [options] Arguments: - The project or solution to operation on. If a file is not specified, the current directory is searched. + The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: -h|--help Show help information"; diff --git a/test/dotnet-remove-p2p.Tests/GivenDotnetRemoveP2P.cs b/test/dotnet-remove-p2p.Tests/GivenDotnetRemoveP2P.cs index 5614077db..a40d5a22a 100644 --- a/test/dotnet-remove-p2p.Tests/GivenDotnetRemoveP2P.cs +++ b/test/dotnet-remove-p2p.Tests/GivenDotnetRemoveP2P.cs @@ -15,10 +15,10 @@ namespace Microsoft.DotNet.Cli.Remove.P2P.Tests { private const string HelpText = @".NET Remove Project to Project (p2p) reference Command -Usage: dotnet remove p2p [options] [args] +Usage: dotnet remove p2p [options] [args] Arguments: - The project or solution to operation on. If a file is not specified, the current directory is searched. + The project file to operate on. If a file is not specified, the command will search the current directory for one. Options: -h|--help Show help information diff --git a/test/dotnet-add-proj.Tests/GivenDotnetAddProj.cs b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs similarity index 93% rename from test/dotnet-add-proj.Tests/GivenDotnetAddProj.cs rename to test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs index 4b012c489..c6fdfdf08 100644 --- a/test/dotnet-add-proj.Tests/GivenDotnetAddProj.cs +++ b/test/dotnet-sln-add.Tests/GivenDotnetSlnAdd.cs @@ -10,22 +10,22 @@ using System.IO; using System.Linq; using Xunit; -namespace Microsoft.DotNet.Cli.Add.Proj.Tests +namespace Microsoft.DotNet.Cli.Sln.Add.Tests { - public class GivenDotnetAddProj : TestBase + public class GivenDotnetSlnAdd : TestBase { - private string HelpText = @".NET Add Project to Solution Command + private string HelpText = @".NET Add project(s) to a solution file Command -Usage: dotnet add project [options] [args] +Usage: dotnet sln add [options] [args] Arguments: - The project or solution to operation on. If a file is not specified, the current directory is searched. + Solution file to operate on. If not specified, the command will search the current directory for one. Options: -h|--help Show help information Additional Arguments: - Projects to add to solution + Add a specified project(s) to the solution. "; private const string ExpectedSlnFileAfterAddingLibProj = @" @@ -185,7 +185,7 @@ EndGlobal public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"add project {helpArg}"); + .ExecuteWithCapturedOutput($"sln add {helpArg}"); cmd.Should().Pass(); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -196,7 +196,7 @@ EndGlobal public void WhenNoCommandIsPassedItPrintsError(string commandName) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"add {commandName}"); + .ExecuteWithCapturedOutput($"sln {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); } @@ -205,7 +205,7 @@ EndGlobal public void WhenTooManyArgumentsArePassedItPrintsError() { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput("add one.sln two.sln three.sln project"); + .ExecuteWithCapturedOutput("sln one.sln two.sln three.sln add"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Unrecognized command or argument 'two.sln'"); cmd.StdOut.Should().Be("Specify --help for a list of available options and commands."); @@ -220,7 +220,7 @@ EndGlobal public void WhenNonExistingSolutionIsPassedItPrintsErrorAndUsage(string solutionName) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"add {solutionName} project p.csproj"); + .ExecuteWithCapturedOutput($"sln {solutionName} add p.csproj"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Could not find solution or directory `{solutionName}`."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -239,7 +239,7 @@ EndGlobal var projectToAdd = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add InvalidSolution.sln project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln InvalidSolution.sln add {projectToAdd}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -259,7 +259,7 @@ EndGlobal var projectToAdd = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln add {projectToAdd}"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing"); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -277,7 +277,7 @@ EndGlobal var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput(@"add App.sln project"); + .ExecuteWithCapturedOutput(@"sln App.sln add"); cmd.Should().Fail(); cmd.StdErr.Should().Be("You must specify at least one project to add."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -296,7 +296,7 @@ EndGlobal var solutionPath = Path.Combine(projectDirectory, "App"); var cmd = new DotnetCommand() .WithWorkingDirectory(solutionPath) - .ExecuteWithCapturedOutput(@"add project App.csproj"); + .ExecuteWithCapturedOutput(@"sln add App.csproj"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Specified solution file {solutionPath + Path.DirectorySeparatorChar} does not exist, or there is no solution file in the directory."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -315,7 +315,7 @@ EndGlobal var projectToAdd = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln add {projectToAdd}"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Found more than one solution file in {projectDirectory + Path.DirectorySeparatorChar}. Please specify which one to use."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -334,7 +334,7 @@ EndGlobal var projectToAdd = Path.Combine("src", "Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add App.sln project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); cmd.Should().Pass(); var slnPath = Path.Combine(projectDirectory, "App.sln"); @@ -362,7 +362,7 @@ EndGlobal var projectToAdd = "Lib/Lib.csproj"; var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add App.sln project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); cmd.Should().Pass(); var slnPath = Path.Combine(projectDirectory, "App.sln"); @@ -393,7 +393,7 @@ EndGlobal var projectPath = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add App.sln project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); cmd.Should().Pass(); cmd.StdOut.Should().Be($"Project `{projectPath}` added to the solution."); cmd.StdErr.Should().BeEmpty(); @@ -415,7 +415,7 @@ EndGlobal var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput(@"add App.sln project App/App.csproj Lib/Lib.csproj"); + .ExecuteWithCapturedOutput(@"sln App.sln add App/App.csproj Lib/Lib.csproj"); cmd.Should().Pass(); var slnPath = Path.Combine(projectDirectory, "App.sln"); @@ -463,7 +463,7 @@ EndGlobal var projectToAdd = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add App.sln project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); cmd.Should().Pass(); cmd.StdOut.Should().Be($"Solution {solutionPath} already contains project {projectToAdd}."); cmd.StdErr.Should().BeEmpty(); @@ -485,7 +485,7 @@ EndGlobal var projectToAdd = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add App.sln project {projectToAdd} idonotexist.csproj"); + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd} idonotexist.csproj"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Project `idonotexist.csproj` does not exist."); @@ -510,7 +510,7 @@ EndGlobal var projectToAdd = Path.Combine("UnknownProject", "UnknownProject.unknownproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add App.sln project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); cmd.Should().Fail(); cmd.StdErr.Should().BeVisuallyEquivalentTo("Unsupported project type. Please check with your sdk provider."); @@ -541,7 +541,7 @@ EndGlobal var projectToAdd = Path.Combine(projectDir, projectName); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"add App.sln project {projectToAdd}"); + .ExecuteWithCapturedOutput($"sln App.sln add {projectToAdd}"); cmd.Should().Pass(); cmd.StdOut.Should().Be($"Project `{projectToAdd}` added to the solution."); cmd.StdErr.Should().BeEmpty(); diff --git a/test/dotnet-add-proj.Tests/MSBuild.exe b/test/dotnet-sln-add.Tests/MSBuild.exe similarity index 100% rename from test/dotnet-add-proj.Tests/MSBuild.exe rename to test/dotnet-sln-add.Tests/MSBuild.exe diff --git a/test/dotnet-add-proj.Tests/MSBuild.exe.config b/test/dotnet-sln-add.Tests/MSBuild.exe.config similarity index 100% rename from test/dotnet-add-proj.Tests/MSBuild.exe.config rename to test/dotnet-sln-add.Tests/MSBuild.exe.config diff --git a/test/dotnet-add-proj.Tests/dotnet-add-proj.Tests.csproj b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj similarity index 97% rename from test/dotnet-add-proj.Tests/dotnet-add-proj.Tests.csproj rename to test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj index 2f176ac2e..08a73c20e 100644 --- a/test/dotnet-add-proj.Tests/dotnet-add-proj.Tests.csproj +++ b/test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj @@ -4,7 +4,7 @@ netcoreapp1.0 true - dotnet-add-proj.Tests + dotnet-sln-add.Tests $(PackageTargetFallback);dotnet5.4;portable-net451+win8 diff --git a/test/dotnet-list-proj.Tests/GivenDotnetListProj.cs b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs similarity index 85% rename from test/dotnet-list-proj.Tests/GivenDotnetListProj.cs rename to test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs index 26e3a316b..aa032eed8 100644 --- a/test/dotnet-list-proj.Tests/GivenDotnetListProj.cs +++ b/test/dotnet-sln-list.Tests/GivenDotnetSlnList.cs @@ -9,16 +9,16 @@ using System.IO; using System.Linq; using Xunit; -namespace Microsoft.DotNet.Cli.List.Proj.Tests +namespace Microsoft.DotNet.Cli.Sln.List.Tests { - public class GivenDotnetListProj : TestBase + public class GivenDotnetSlnList : TestBase { - private const string HelpText = @".NET Projects in Solution viewer + private const string HelpText = @".NET List project(s) in a solution file Command -Usage: dotnet list projects [options] +Usage: dotnet sln list [options] Arguments: - The project or solution to operation on. If a file is not specified, the current directory is searched. + Solution file to operate on. If not specified, the command will search the current directory for one. Options: -h|--help Show help information"; @@ -29,7 +29,7 @@ Options: public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"list projects {helpArg}"); + .ExecuteWithCapturedOutput($"sln list {helpArg}"); cmd.Should().Pass(); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -40,7 +40,7 @@ Options: public void WhenNoCommandIsPassedItPrintsError(string commandName) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"list {commandName}"); + .ExecuteWithCapturedOutput($"sln {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); } @@ -49,7 +49,7 @@ Options: public void WhenTooManyArgumentsArePassedItPrintsError() { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput("list one.sln two.sln three.sln projects"); + .ExecuteWithCapturedOutput("sln one.sln two.sln three.sln list"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Unrecognized command or argument 'two.sln'"); } @@ -63,7 +63,7 @@ Options: public void WhenNonExistingSolutionIsPassedItPrintsErrorAndUsage(string solutionName) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"list {solutionName} projects"); + .ExecuteWithCapturedOutput($"sln {solutionName} list"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Could not find solution or directory `{solutionName}`."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -81,7 +81,7 @@ Options: var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("list InvalidSolution.sln projects"); + .ExecuteWithCapturedOutput("sln InvalidSolution.sln list"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -100,7 +100,7 @@ Options: var solutionFullPath = Path.Combine(projectDirectory, "InvalidSolution.sln"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("list projects"); + .ExecuteWithCapturedOutput("sln list"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Invalid solution `{solutionFullPath}`. Invalid format in line 1: File header is missing"); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -119,7 +119,7 @@ Options: var solutionDir = Path.Combine(projectDirectory, "App"); var cmd = new DotnetCommand() .WithWorkingDirectory(solutionDir) - .ExecuteWithCapturedOutput("list projects"); + .ExecuteWithCapturedOutput("sln list"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Specified solution file {solutionDir + Path.DirectorySeparatorChar} does not exist, or there is no solution file in the directory."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -137,7 +137,7 @@ Options: var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("list projects"); + .ExecuteWithCapturedOutput("sln list"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Found more than one solution file in {projectDirectory + Path.DirectorySeparatorChar}. Please specify which one to use."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -155,7 +155,7 @@ Options: var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("list projects"); + .ExecuteWithCapturedOutput("sln list"); cmd.Should().Pass(); cmd.StdOut.Should().Be("No projects found in the solution."); } @@ -177,7 +177,7 @@ Options: var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("list projects"); + .ExecuteWithCapturedOutput("sln list"); cmd.Should().Pass(); cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText); } diff --git a/test/dotnet-list-proj.Tests/MSBuild.exe b/test/dotnet-sln-list.Tests/MSBuild.exe similarity index 100% rename from test/dotnet-list-proj.Tests/MSBuild.exe rename to test/dotnet-sln-list.Tests/MSBuild.exe diff --git a/test/dotnet-list-proj.Tests/MSBuild.exe.config b/test/dotnet-sln-list.Tests/MSBuild.exe.config similarity index 100% rename from test/dotnet-list-proj.Tests/MSBuild.exe.config rename to test/dotnet-sln-list.Tests/MSBuild.exe.config diff --git a/test/dotnet-list-proj.Tests/dotnet-list-proj.Tests.csproj b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj similarity index 96% rename from test/dotnet-list-proj.Tests/dotnet-list-proj.Tests.csproj rename to test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj index 6373c806a..9c5727e68 100644 --- a/test/dotnet-list-proj.Tests/dotnet-list-proj.Tests.csproj +++ b/test/dotnet-sln-list.Tests/dotnet-sln-list.Tests.csproj @@ -4,7 +4,7 @@ netcoreapp1.0 true - dotnet-list-proj.Tests + dotnet-sln-list.Tests $(PackageTargetFallback);dotnet5.4;portable-net451+win8 diff --git a/test/dotnet-remove-proj.Tests/GivenDotnetRemoveProj.cs b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs similarity index 91% rename from test/dotnet-remove-proj.Tests/GivenDotnetRemoveProj.cs rename to test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs index 74eebdd0e..9b226515c 100644 --- a/test/dotnet-remove-proj.Tests/GivenDotnetRemoveProj.cs +++ b/test/dotnet-sln-remove.Tests/GivenDotnetSlnRemove.cs @@ -9,22 +9,22 @@ using System.IO; using System.Linq; using Xunit; -namespace Microsoft.DotNet.Cli.Remove.Project.Tests +namespace Microsoft.DotNet.Cli.Sln.Remove.Tests { - public class GivenDotnetRemoveProj : TestBase + public class GivenDotnetSlnRemove : TestBase { - private const string HelpText = @".NET Remove Project from Solution Command + private const string HelpText = @".NET Remove project(s) from a solution file Command -Usage: dotnet remove project [options] [args] +Usage: dotnet sln remove [options] [args] Arguments: - The project or solution to operation on. If a file is not specified, the current directory is searched. + Solution file to operate on. If not specified, the command will search the current directory for one. Options: -h|--help Show help information Additional Arguments: - Projects to remove from a solution + Remove the specified project(s) from the solution. The project is not impacted. "; private const string ExpectedSlnContentsAfterRemove = @" @@ -166,7 +166,7 @@ EndGlobal public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"remove project {helpArg}"); + .ExecuteWithCapturedOutput($"sln remove {helpArg}"); cmd.Should().Pass(); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); } @@ -175,7 +175,7 @@ EndGlobal public void WhenTooManyArgumentsArePassedItPrintsError() { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput("remove one.sln two.sln three.sln project"); + .ExecuteWithCapturedOutput("sln one.sln two.sln three.sln remove"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Unrecognized command or argument 'two.sln'"); cmd.StdOut.Should().Be("Specify --help for a list of available options and commands."); @@ -187,7 +187,7 @@ EndGlobal public void WhenNoCommandIsPassedItPrintsError(string commandName) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"remove {commandName}"); + .ExecuteWithCapturedOutput($"sln {commandName}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Required command was not provided."); } @@ -201,7 +201,7 @@ EndGlobal public void WhenNonExistingSolutionIsPassedItPrintsErrorAndUsage(string solutionName) { var cmd = new DotnetCommand() - .ExecuteWithCapturedOutput($"remove {solutionName} project p.csproj"); + .ExecuteWithCapturedOutput($"sln {solutionName} remove p.csproj"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Could not find solution or directory `{solutionName}`."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -220,7 +220,7 @@ EndGlobal var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove InvalidSolution.sln project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln InvalidSolution.sln remove {projectToRemove}"); cmd.Should().Fail(); cmd.StdErr.Should().Be("Invalid solution `InvalidSolution.sln`. Invalid format in line 1: File header is missing"); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -240,7 +240,7 @@ EndGlobal var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Invalid solution `{solutionPath}`. Invalid format in line 1: File header is missing"); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -258,7 +258,7 @@ EndGlobal var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput(@"remove App.sln project"); + .ExecuteWithCapturedOutput(@"sln App.sln remove"); cmd.Should().Fail(); cmd.StdErr.Should().Be("You must specify at least one project to remove."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -277,7 +277,7 @@ EndGlobal var solutionPath = Path.Combine(projectDirectory, "App"); var cmd = new DotnetCommand() .WithWorkingDirectory(solutionPath) - .ExecuteWithCapturedOutput(@"remove project App.csproj"); + .ExecuteWithCapturedOutput(@"sln remove App.csproj"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Specified solution file {solutionPath + Path.DirectorySeparatorChar} does not exist, or there is no solution file in the directory."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -296,7 +296,7 @@ EndGlobal var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Fail(); cmd.StdErr.Should().Be($"Found more than one solution file in {projectDirectory + Path.DirectorySeparatorChar}. Please specify which one to use."); cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText); @@ -316,7 +316,7 @@ EndGlobal var contentBefore = File.ReadAllText(solutionPath); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput("remove project referenceDoesNotExistInSln.csproj"); + .ExecuteWithCapturedOutput("sln remove referenceDoesNotExistInSln.csproj"); cmd.Should().Pass(); cmd.StdOut.Should().Be("Project reference `referenceDoesNotExistInSln.csproj` could not be found."); File.ReadAllText(solutionPath) @@ -340,7 +340,7 @@ EndGlobal var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Pass(); cmd.StdOut.Should().Be($"Project reference `{projectToRemove}` removed."); @@ -366,7 +366,7 @@ EndGlobal var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Pass(); string outputText = $@"Project reference `{projectToRemove}` removed. @@ -395,7 +395,7 @@ Project reference `{projectToRemove}` removed."; var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project idontexist.csproj {projectToRemove} idontexisteither.csproj"); + .ExecuteWithCapturedOutput($"sln remove idontexist.csproj {projectToRemove} idontexisteither.csproj"); cmd.Should().Pass(); string outputText = $@"Project reference `idontexist.csproj` could not be found. @@ -425,7 +425,7 @@ Project reference `idontexisteither.csproj` could not be found."; var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Pass(); File.ReadAllText(solutionPath) @@ -449,7 +449,7 @@ Project reference `idontexisteither.csproj` could not be found."; var projectToRemove = Path.Combine("Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Pass(); new DotnetCommand() @@ -492,7 +492,7 @@ Project reference `idontexisteither.csproj` could not be found."; var projectsToRemove = $"{libPath} {appPath}"; var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectsToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectsToRemove}"); cmd.Should().Pass(); File.ReadAllText(solutionPath) @@ -514,7 +514,7 @@ Project reference `idontexisteither.csproj` could not be found."; var projectToRemove = Path.Combine("src", "NotLastProjInSrc", "NotLastProjInSrc.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Pass(); File.ReadAllText(solutionPath) @@ -536,7 +536,7 @@ Project reference `idontexisteither.csproj` could not be found."; var projectToRemove = Path.Combine("src", "Lib", "Lib.csproj"); var cmd = new DotnetCommand() .WithWorkingDirectory(projectDirectory) - .ExecuteWithCapturedOutput($"remove project {projectToRemove}"); + .ExecuteWithCapturedOutput($"sln remove {projectToRemove}"); cmd.Should().Pass(); File.ReadAllText(solutionPath) diff --git a/test/dotnet-remove-proj.Tests/MSBuild.exe b/test/dotnet-sln-remove.Tests/MSBuild.exe similarity index 100% rename from test/dotnet-remove-proj.Tests/MSBuild.exe rename to test/dotnet-sln-remove.Tests/MSBuild.exe diff --git a/test/dotnet-remove-proj.Tests/MSBuild.exe.config b/test/dotnet-sln-remove.Tests/MSBuild.exe.config similarity index 100% rename from test/dotnet-remove-proj.Tests/MSBuild.exe.config rename to test/dotnet-sln-remove.Tests/MSBuild.exe.config diff --git a/test/dotnet-remove-proj.Tests/dotnet-remove-proj.Tests.csproj b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj similarity index 96% rename from test/dotnet-remove-proj.Tests/dotnet-remove-proj.Tests.csproj rename to test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj index dcdad415f..50a6d2592 100644 --- a/test/dotnet-remove-proj.Tests/dotnet-remove-proj.Tests.csproj +++ b/test/dotnet-sln-remove.Tests/dotnet-sln-remove.Tests.csproj @@ -4,7 +4,7 @@ netcoreapp1.0 true - dotnet-remove-proj.Tests + dotnet-sln-remove.Tests $(PackageTargetFallback);dotnet5.4;portable-net451+win8