dotnet list p2ps -> dotnet list reference
This commit is contained in:
parent
528d37bda5
commit
7042e85292
22 changed files with 19 additions and 19 deletions
|
@ -7,7 +7,7 @@ namespace Microsoft.DotNet.Tools.List.ProjectToProjectReferences
|
||||||
{
|
{
|
||||||
public const string AppFullName = ".NET Core Project-to-Project dependency viewer";
|
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). ";
|
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). ";
|
||||||
}
|
}
|
|
@ -14,7 +14,7 @@ namespace Microsoft.DotNet.Tools.List.ProjectToProjectReferences
|
||||||
{
|
{
|
||||||
var command = new ListProjectToProjectReferencesCommand()
|
var command = new ListProjectToProjectReferencesCommand()
|
||||||
{
|
{
|
||||||
Name = "p2ps",
|
Name = "reference",
|
||||||
FullName = LocalizableStrings.AppFullName,
|
FullName = LocalizableStrings.AppFullName,
|
||||||
Description = LocalizableStrings.AppDescription,
|
Description = LocalizableStrings.AppDescription,
|
||||||
};
|
};
|
|
@ -5,22 +5,22 @@ using Microsoft.DotNet.Cli.Utils;
|
||||||
|
|
||||||
namespace Microsoft.DotNet.Tools.Test.Utilities
|
namespace Microsoft.DotNet.Tools.Test.Utilities
|
||||||
{
|
{
|
||||||
public sealed class ListP2PsCommand : TestCommand
|
public sealed class ListReferenceCommand : TestCommand
|
||||||
{
|
{
|
||||||
private string _projectName = null;
|
private string _projectName = null;
|
||||||
|
|
||||||
public ListP2PsCommand()
|
public ListReferenceCommand()
|
||||||
: base("dotnet")
|
: base("dotnet")
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override CommandResult Execute(string args = "")
|
public override CommandResult Execute(string args = "")
|
||||||
{
|
{
|
||||||
args = $"list {_projectName} p2ps {args}";
|
args = $"list {_projectName} reference {args}";
|
||||||
return base.ExecuteWithCapturedOutput(args);
|
return base.ExecuteWithCapturedOutput(args);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ListP2PsCommand WithProject(string projectName)
|
public ListReferenceCommand WithProject(string projectName)
|
||||||
{
|
{
|
||||||
_projectName = projectName;
|
_projectName = projectName;
|
||||||
return this;
|
return this;
|
|
@ -4,7 +4,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
<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>
|
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);dotnet5.4;portable-net451+win8</PackageTargetFallback>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,13 @@ using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Xunit;
|
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
|
private const string HelpText = @".NET Core Project-to-Project dependency viewer
|
||||||
|
|
||||||
Usage: dotnet list <PROJECT> p2ps [options]
|
Usage: dotnet list <PROJECT> reference [options]
|
||||||
|
|
||||||
Arguments:
|
Arguments:
|
||||||
<PROJECT> The project file to operate on. If a file is not specified, the command will search the current directory for one.
|
<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")]
|
[InlineData("-h")]
|
||||||
public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg)
|
public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg)
|
||||||
{
|
{
|
||||||
var cmd = new ListP2PsCommand().Execute(helpArg);
|
var cmd = new ListReferenceCommand().Execute(helpArg);
|
||||||
cmd.Should().Pass();
|
cmd.Should().Pass();
|
||||||
cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText);
|
cmd.StdOut.Should().BeVisuallyEquivalentTo(HelpText);
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ Options:
|
||||||
{
|
{
|
||||||
var setup = Setup();
|
var setup = Setup();
|
||||||
|
|
||||||
var cmd = new ListP2PsCommand()
|
var cmd = new ListReferenceCommand()
|
||||||
.WithWorkingDirectory(setup.TestRoot)
|
.WithWorkingDirectory(setup.TestRoot)
|
||||||
.WithProject(projName)
|
.WithProject(projName)
|
||||||
.Execute($"\"{setup.ValidRefCsprojPath}\"");
|
.Execute($"\"{setup.ValidRefCsprojPath}\"");
|
||||||
|
@ -81,7 +81,7 @@ Options:
|
||||||
string projName = "Broken/Broken.csproj";
|
string projName = "Broken/Broken.csproj";
|
||||||
var setup = Setup();
|
var setup = Setup();
|
||||||
|
|
||||||
var cmd = new ListP2PsCommand()
|
var cmd = new ListReferenceCommand()
|
||||||
.WithWorkingDirectory(setup.TestRoot)
|
.WithWorkingDirectory(setup.TestRoot)
|
||||||
.WithProject(projName)
|
.WithProject(projName)
|
||||||
.Execute($"\"{setup.ValidRefCsprojPath}\"");
|
.Execute($"\"{setup.ValidRefCsprojPath}\"");
|
||||||
|
@ -96,7 +96,7 @@ Options:
|
||||||
var setup = Setup();
|
var setup = Setup();
|
||||||
|
|
||||||
var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne");
|
var workingDir = Path.Combine(setup.TestRoot, "MoreThanOne");
|
||||||
var cmd = new ListP2PsCommand()
|
var cmd = new ListReferenceCommand()
|
||||||
.WithWorkingDirectory(workingDir)
|
.WithWorkingDirectory(workingDir)
|
||||||
.Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\"");
|
.Execute($"\"{setup.ValidRefCsprojRelToOtherProjPath}\"");
|
||||||
cmd.ExitCode.Should().NotBe(0);
|
cmd.ExitCode.Should().NotBe(0);
|
||||||
|
@ -109,7 +109,7 @@ Options:
|
||||||
{
|
{
|
||||||
var setup = Setup();
|
var setup = Setup();
|
||||||
|
|
||||||
var cmd = new ListP2PsCommand()
|
var cmd = new ListReferenceCommand()
|
||||||
.WithWorkingDirectory(setup.TestRoot)
|
.WithWorkingDirectory(setup.TestRoot)
|
||||||
.Execute($"\"{setup.ValidRefCsprojPath}\"");
|
.Execute($"\"{setup.ValidRefCsprojPath}\"");
|
||||||
cmd.ExitCode.Should().NotBe(0);
|
cmd.ExitCode.Should().NotBe(0);
|
||||||
|
@ -122,7 +122,7 @@ Options:
|
||||||
{
|
{
|
||||||
var lib = NewLib();
|
var lib = NewLib();
|
||||||
|
|
||||||
var cmd = new ListP2PsCommand()
|
var cmd = new ListReferenceCommand()
|
||||||
.WithProject(lib.CsProjPath)
|
.WithProject(lib.CsProjPath)
|
||||||
.Execute();
|
.Execute();
|
||||||
cmd.Should().Pass();
|
cmd.Should().Pass();
|
||||||
|
@ -140,7 +140,7 @@ Options:
|
||||||
string ref1 = NewLib("ItPrintsSingleReference", "ref").CsProjPath;
|
string ref1 = NewLib("ItPrintsSingleReference", "ref").CsProjPath;
|
||||||
AddValidRef(ref1, lib);
|
AddValidRef(ref1, lib);
|
||||||
|
|
||||||
var cmd = new ListP2PsCommand()
|
var cmd = new ListReferenceCommand()
|
||||||
.WithProject(lib.CsProjPath)
|
.WithProject(lib.CsProjPath)
|
||||||
.Execute();
|
.Execute();
|
||||||
cmd.Should().Pass();
|
cmd.Should().Pass();
|
||||||
|
@ -165,7 +165,7 @@ Options:
|
||||||
AddValidRef(ref2, lib);
|
AddValidRef(ref2, lib);
|
||||||
AddValidRef(ref3, lib);
|
AddValidRef(ref3, lib);
|
||||||
|
|
||||||
var cmd = new ListP2PsCommand()
|
var cmd = new ListReferenceCommand()
|
||||||
.WithProject(lib.CsProjPath)
|
.WithProject(lib.CsProjPath)
|
||||||
.Execute();
|
.Execute();
|
||||||
cmd.Should().Pass();
|
cmd.Should().Pass();
|
|
@ -4,7 +4,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netcoreapp1.0</TargetFramework>
|
<TargetFramework>netcoreapp1.0</TargetFramework>
|
||||||
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
|
<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>
|
<PackageTargetFallback Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">$(PackageTargetFallback);dotnet5.4;portable-net451+win8</PackageTargetFallback>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
Loading…
Reference in a new issue