예제 #1
0
        public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg)
        {
            var cmd = new ListReferenceCommand().Execute(helpArg);

            cmd.Should().Pass();
            cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText);
        }
예제 #2
0
        public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg)
        {
            var cmd = new ListReferenceCommand(Log).Execute(helpArg);

            cmd.Should().Pass();
            cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(ListProjectReferenceCommandHelpText(Directory.GetCurrentDirectory()));
        }
예제 #3
0
        public void ItPrintsMultipleReferences()
        {
            string OutputText = CommonLocalizableStrings.ProjectReferenceOneOrMore;

            OutputText += $@"
{new string('-', OutputText.Length)}
..\ref1\ref1.csproj
..\ref2\ref2.csproj
..\ref3\ref3.csproj";

            var    lib  = NewLib("lib");
            string ref1 = NewLib("ref1").CsProjPath;
            string ref2 = NewLib("ref2").CsProjPath;
            string ref3 = NewLib("ref3").CsProjPath;

            AddValidRef(ref1, lib);
            AddValidRef(ref2, lib);
            AddValidRef(ref3, lib);

            var cmd = new ListReferenceCommand()
                      .WithProject(lib.CsProjPath)
                      .Execute();

            cmd.Should().Pass();
            cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText);
        }
예제 #4
0
        public void WhenNoProjectReferencesArePresentInTheProjectItPrintsError()
        {
            var lib = NewLib();

            var cmd = new ListReferenceCommand()
                      .WithProject(lib.CsProjPath)
                      .Execute();

            cmd.Should().Pass();
            cmd.StdOut.Should().Be(string.Format(CommonLocalizableStrings.NoReferencesFound, CommonLocalizableStrings.P2P, lib.CsProjPath));
        }
예제 #5
0
        public void WhenNoProjectReferencesArePresentInTheProjectItPrintsError()
        {
            var lib = NewLib();

            var cmd = new ListReferenceCommand()
                      .WithProject(lib.CsProjPath)
                      .Execute();

            cmd.Should().Pass();
            cmd.StdOut.Should().Be($"There are no Project to Project references in project {lib.CsProjPath}. ;; Project to Project is the type of the item being requested (project, package, p2p) and {lib.CsProjPath} is the object operated on (a project file or a solution file). ");
        }
예제 #6
0
        public void ItPrintsSingleReference()
        {
            const string OutputText = @"Project reference(s)
--------------------
..\ref\ref.csproj";

            var    lib  = NewLib("lib");
            string ref1 = NewLib("ref").CsProjPath;

            AddValidRef(ref1, lib);

            var cmd = new ListReferenceCommand()
                      .WithProject(lib.CsProjPath)
                      .Execute();

            cmd.Should().Pass();
            cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText);
        }
예제 #7
0
        public void ItPrintsSingleReference()
        {
            string OutputText = CommonLocalizableStrings.ProjectReferenceOneOrMore;

            OutputText += $@"
{new string('-', OutputText.Length)}
..\ref\ref.csproj";

            var testDirectory = _testAssetsManager.CreateTestDirectory().Path;

            var    lib  = NewLib(testDirectory, "lib");
            string ref1 = NewLib(testDirectory, "ref").CsProjPath;

            AddValidRef(ref1, lib);

            var cmd = new ListReferenceCommand(Log)
                      .WithProject(lib.CsProjPath)
                      .Execute();

            cmd.Should().Pass();
            cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText);
        }
예제 #8
0
        public void ItPrintsMultipleReferences()
        {
            const string OutputText = @"Project reference(s)
--------------------
..\ItPrintsSingleReferenceref1\ItPrintsSingleReferenceref1.csproj
..\ItPrintsSingleReferenceref2\ItPrintsSingleReferenceref2.csproj
..\ItPrintsSingleReferenceref3\ItPrintsSingleReferenceref3.csproj";

            var    lib  = NewLib("ItPrintsSingleReference", "lib");
            string ref1 = NewLib("ItPrintsSingleReference", "ref1").CsProjPath;
            string ref2 = NewLib("ItPrintsSingleReference", "ref2").CsProjPath;
            string ref3 = NewLib("ItPrintsSingleReference", "ref3").CsProjPath;

            AddValidRef(ref1, lib);
            AddValidRef(ref2, lib);
            AddValidRef(ref3, lib);

            var cmd = new ListReferenceCommand()
                      .WithProject(lib.CsProjPath)
                      .Execute();

            cmd.Should().Pass();
            cmd.StdOut.Should().BeVisuallyEquivalentTo(OutputText);
        }