public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) { var cmd = new ListReferenceCommand().Execute(helpArg); cmd.Should().Pass(); cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(HelpText); }
public void WhenHelpOptionIsPassedItPrintsUsage(string helpArg) { var cmd = new ListReferenceCommand(Log).Execute(helpArg); cmd.Should().Pass(); cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(ListProjectReferenceCommandHelpText(Directory.GetCurrentDirectory())); }
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); }
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)); }
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). "); }
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); }
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); }
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); }