44#include " WorkflowCommon.h"
55#include " DependenciesTestSource.h"
66#include < Commands/InstallCommand.h>
7+ #include < Commands/COMCommand.h>
78#include < Workflows/DependenciesFlow.h>
89#include < Workflows/InstallFlow.h>
10+ #include < Workflows/ShellExecuteInstallerHandler.h>
911
1012using namespace TestCommon ;
1113using namespace AppInstaller ::CLI;
@@ -38,6 +40,14 @@ void OverrideForProcessMultiplePackages(TestContext& context)
3840 } });
3941}
4042
43+ void OverrideShellExecute (TestContext& context)
44+ {
45+ context.Override ({ ShellExecuteInstallImpl, [](TestContext& c)
46+ {
47+ c.Add < Execution::Data::OperationReturnCode>(0 );
48+ } });
49+ }
50+
4151TEST_CASE (" DependencyGraph_SkipInstalled" , " [InstallFlow][workflow][dependencyGraph][dependencies]" )
4252{
4353 TestCommon::TempFile installResultPath (" TestExeInstalled.txt" );
@@ -264,7 +274,26 @@ TEST_CASE("InstallFlow_Dependencies", "[InstallFlow][workflow][dependencies]")
264274 REQUIRE (installOutput.str ().find (" PreviewIIS" ) != std::string::npos);
265275}
266276
277+ TEST_CASE (" InstallFlow_Dependencies_COM" , " [InstallFlow][workflow][dependencies]" )
278+ {
279+ std::ostringstream installOutput;
280+ TestContext context{ installOutput, std::cin };
281+ auto previousThreadGlobals = context.SetForCurrentThread ();
282+ OverrideForShellExecute (context);
283+ OverrideShellExecute (context);
284+ OverrideOpenDependencySource (context);
285+ OverrideEnableWindowsFeaturesDependencies (context);
286+
287+ context.Add <Execution::Data::Manifest>(YamlParser::CreateFromPath (TestDataFile (" InstallFlowTest_MultipleDependencies.yaml" )));
288+
289+ COMDownloadCommand download ({});
290+ download.Execute (context);
291+
292+ COMInstallCommand install ({});
293+ REQUIRE_NOTHROW (install.Execute (context));
294+ }
295+
267296// TODO:
268297// add dependencies for installer tests to DependenciesTestSource (or a new one)
269298// add tests for min version dependency solving
270- // add tests that check for correct installation of dependencies (not only the order)
299+ // add tests that check for correct installation of dependencies (not only the order)
0 commit comments