Workflow execution for the bind command
        void IBindingWorkflowExecutor.BindProject(BindCommandArgs bindingArgs)
        {
            var bindingProcess = CreateBindingProcess(host, bindingArgs);
            var workflow       = new BindingWorkflow(host, bindingProcess);

            IProgressEvents progressEvents = workflow.Run();

            Debug.Assert(progressEvents != null, "BindingWorkflow.Run returned null");
            this.SetBindingInProgress(progressEvents, bindingArgs);
        }
        void IBindingWorkflowExecutor.BindProject(ProjectInformation projectInformation)
        {
            ConnectionInformation connection = this.host.VisualStateManager.GetConnectedServer(projectInformation);

            Debug.Assert(connection != null, "Could not find a connected server for project: " + projectInformation?.Key);

            BindingWorkflow workflowExecutor = new BindingWorkflow(this.host, connection, projectInformation);
            IProgressEvents progressEvents   = workflowExecutor.Run();

            Debug.Assert(progressEvents != null, "BindingWorkflow.Run returned null");
            this.SetBindingInProgress(progressEvents, projectInformation);
        }
        private static void VerifyNuGetPackgesDownloaded(IEnumerable<PackageName> expectedPackages, BindingWorkflow testSubject)
        {
            var expected = expectedPackages.ToArray();
            var actual = testSubject.NuGetPackages.Select(x => new PackageName(x.Id, new SemanticVersion(x.Version))).ToArray();

            Assert.AreEqual(expected.Length, actual.Length, "Different number of packages.");

            for (int i = 0; i < expected.Length; i++)
            {
                Assert.IsTrue(expected[i].Equals(actual[i]), $"Packages are different at index {i}.");
            }
        }
        void IBindingWorkflowExecutor.BindProject(ProjectInformation projectInformation)
        {
            ConnectionInformation connection = this.host.VisualStateManager.GetConnectedServer(projectInformation);
            Debug.Assert(connection != null, "Could not find a connected server for project: " + projectInformation?.Key);

            BindingWorkflow workflowExecutor = new BindingWorkflow(this.host, connection, projectInformation);
            IProgressEvents progressEvents = workflowExecutor.Run();
            Debug.Assert(progressEvents != null, "BindingWorkflow.Run returned null");
            this.SetBindingInProgress(progressEvents, projectInformation);
        }
        private ConfigurablePackageInstaller PrepareInstallPackagesTest(BindingWorkflow testSubject, IEnumerable<PackageName> nugetPackages, params Project[] projects)
        {
            testSubject.BindingProjects.Clear();
            testSubject.BindingProjects.AddRange(projects);

            foreach (var package in nugetPackages.Select(x => new NuGetPackageInfo { Id = x.Id, Version = x.Version.ToNormalizedString() }))
            {
                testSubject.NuGetPackages.Add(package);
            }

            ConfigurablePackageInstaller packageInstaller = new ConfigurablePackageInstaller(nugetPackages);
            this.serviceProvider.RegisterService(typeof(SComponentModel),
                ConfigurableComponentModel.CreateWithExports(MefTestHelpers.CreateExport<IVsPackageInstaller>(packageInstaller)));

            return packageInstaller;
        }