dotnet list p2ps -> dotnet list reference

This commit is contained in:
Krzysztof Wicher 2017-01-06 14:25:23 -08:00
parent 528d37bda5
commit 7042e85292
22 changed files with 19 additions and 19 deletions

View file

@ -7,7 +7,7 @@ namespace Microsoft.DotNet.Tools.List.ProjectToProjectReferences
{
public const string AppFullName = ".NET Core Project-to-Project dependency viewer";
public const string AppDescription = "Command to list project to project (p2p) references";
public const string AppDescription = "Command to list project to project references";
public const string NoReferencesFound = "There are no {0} references in project {1}.\n{0} is the type of the item being requested (project, package, p2p) and {1} is the object operated on (a project file or a solution file). ";
}

View file

@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.List.ProjectToProjectReferences
{
var command = new ListProjectToProjectReferencesCommand()
{
Name = "p2ps",
Name = "reference",
FullName = LocalizableStrings.AppFullName,
Description = LocalizableStrings.AppDescription,
};

View file

@ -5,22 +5,22 @@ using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class ListP2PsCommand : TestCommand
public sealed class ListReferenceCommand : TestCommand
{
private string _projectName = null;
public ListP2PsCommand()
public ListReferenceCommand()
: base("dotnet")
{
}
public override CommandResult Execute(string args = "")
{
args = $"list {_projectName} p2ps {args}";
args = $"list {_projectName} reference {args}";
return base.ExecuteWithCapturedOutput(args);
}
public ListP2PsCommand WithProject(string projectName)
public ListReferenceCommand WithProject(string projectName)
{
_projectName = projectName;
return this;

View file

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AssemblyName>dotnet-add-p2p.Tests</AssemblyName>
<AssemblyName>dotnet-add-reference.Tests</AssemblyName>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);dotnet5.4;portable-net451+win8</PackageTargetFallback>
</PropertyGroup>

View file

@ -9,13 +9,13 @@ using System;
using System.IO;
using Xunit;
namespace Microsoft.DotNet.Cli.List.P2P.Tests
namespace Microsoft.DotNet.Cli.List.Reference.Tests
{
public class GivenDotnetListP2Ps : TestBase
public class GivenDotnetListReference : TestBase
{
private const string HelpText = @".NET Core Project-to-Project dependency viewer
Usage: dotnet list <PROJECT> p2ps [options]
Usage: dotnet list <PROJECT> reference [options]
Arguments:
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
@ -33,7 +33,7 @@ Options:
[InlineData("-h")]
public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg)
{
var cmd = new ListP2PsCommand().Execute(helpArg);
var cmd = new ListReferenceCommand().Execute(helpArg);
cmd.Should().Pass();
cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText);
}
@ -66,7 +66,7 @@ Options:
{
var setup = Setup();
var cmd = new ListP2PsCommand()
var cmd = new ListReferenceCommand()
.WithWorkingDirectory(setup.TestRoot)
.WithProject(projName)
.Execute($"\"{setup.ValidRefCsprojPath}\"");
@ -81,7 +81,7 @@ Options:
string projName = "Broken/Broken.csproj";
var setup = Setup();
var cmd = new ListP2PsCommand()
var cmd = new ListReferenceCommand()
.WithWorkingDirectory(setup.TestRoot)
.WithProject(projName)
.Execute($"\"{setup.ValidRefCsprojPath}\"");
@ -96,7 +96,7 @@ Options:
var setup = Setup();
var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne");
var cmd = new ListP2PsCommand()
var cmd = new ListReferenceCommand()
.WithWorkingDirectory(workingDir)
.Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\"");
cmd.ExitCode.Should().NotBe(0);
@ -109,7 +109,7 @@ Options:
{
var setup = Setup();
var cmd = new ListP2PsCommand()
var cmd = new ListReferenceCommand()
.WithWorkingDirectory(setup.TestRoot)
.Execute($"\"{setup.ValidRefCsprojPath}\"");
cmd.ExitCode.Should().NotBe(0);
@ -122,7 +122,7 @@ Options:
{
var lib = NewLib();
var cmd = new ListP2PsCommand()
var cmd = new ListReferenceCommand()
.WithProject(lib.CsProjPath)
.Execute();
cmd.Should().Pass();
@ -140,7 +140,7 @@ Options:
string ref1 = NewLib("ItPrintsSingleReference", "ref").CsProjPath;
AddValidRef(ref1, lib);
var cmd = new ListP2PsCommand()
var cmd = new ListReferenceCommand()
.WithProject(lib.CsProjPath)
.Execute();
cmd.Should().Pass();
@ -165,7 +165,7 @@ Options:
AddValidRef(ref2, lib);
AddValidRef(ref3, lib);
var cmd = new ListP2PsCommand()
var cmd = new ListReferenceCommand()
.WithProject(lib.CsProjPath)
.Execute();
cmd.Should().Pass();

View file

@ -4,7 +4,7 @@
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<AssemblyName>dotnet-list-p2ps.Tests</AssemblyName>
<AssemblyName>dotnet-list-reference.Tests</AssemblyName>
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);dotnet5.4;portable-net451+win8</PackageTargetFallback>
</PropertyGroup>