public void TestFrameworkSpecificDependencyToolsCanBeInvoked(string framework, string args, string expectedDependencyToolPath, bool windowsOnly) { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && windowsOnly) { return; } var appDirectory = Path.Combine(_desktopTestProjectsRoot, "AppWithDirectDependencyDesktopAndPortable"); new BuildCommand(Path.Combine(appDirectory, "project.json")) .Execute() .Should() .Pass(); CommandResult result = new DependencyToolInvokerCommand { WorkingDirectory = appDirectory } .ExecuteWithCapturedOutput("desktop-and-portable", framework, args); result.Should().HaveStdOutContaining(framework); result.Should().HaveStdOutContaining(args); result.Should().HaveStdOutContaining(expectedDependencyToolPath); result.Should().NotHaveStdErr(); result.Should().Pass(); }
public void TestFrameworkSpecificLibraryDependencyToolsCannotBeInvoked(string identifier, string framework, string expectedDependencyToolPath, bool windowsOnly) { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && windowsOnly) { return; } var testInstance = _desktopTestAssetsManager .CreateTestInstance("LibraryWithDirectDependencyDesktopAndPortable", identifier: identifier) .WithLockFiles(); var appDirectory = testInstance.Path; new BuildCommand(Path.Combine(appDirectory, "project.json")) .Execute() .Should() .Pass(); CommandResult result = new DependencyToolInvokerCommand { WorkingDirectory = appDirectory } .ExecuteWithCapturedOutput("desktop-and-portable", framework, identifier); result.Should().HaveStdOutContaining("Command not found"); result.Should().Fail(); }
public void Tool_Command_Runs_Executable_Dependency_For_App_With_Config() { var commandResult = new DependencyToolInvokerCommand { WorkingDirectory = _appWithConfigProjectRoot } .Execute("desktop-binding-redirects", "net46", ""); commandResult.Should().Pass(); }
public void CanInvokeToolFromDirectDependenciesIfPackageNameDifferentFromToolName() { var appDirectory = Path.Combine(_testProjectsRoot, "AppWithDirectDependencyWithOutputName"); const string framework = ".NETCoreApp,Version=v1.0"; new BuildCommand(Path.Combine(appDirectory, "project.json")) .Execute() .Should() .Pass(); CommandResult result = new DependencyToolInvokerCommand { WorkingDirectory = appDirectory } .ExecuteWithCapturedOutput("tool-with-output-name", framework, string.Empty); result.Should().HaveStdOutContaining("Tool with output name!"); result.Should().NotHaveStdErr(); result.Should().Pass(); }
public void CanInvokeToolFromDirectDependenciesIfPackageNameDifferentFromToolName() { var testInstance = TestAssetsManager .CreateTestInstance("AppWithDirectDepWithOutputName") .WithBuildArtifacts() .WithLockFiles(); var appDirectory = testInstance.Path; const string framework = ".NETCoreApp,Version=v1.0"; new BuildCommand(Path.Combine(appDirectory, "project.json")) .Execute() .Should() .Pass(); CommandResult result = new DependencyToolInvokerCommand { WorkingDirectory = appDirectory } .ExecuteWithCapturedOutput("tool-with-output-name", framework, string.Empty); result.Should().HaveStdOutContaining("Tool with output name!"); result.Should().NotHaveStdErr(); result.Should().Pass(); }