示例#1
0
        private static void ApplyProjectBuild(AbstractEvaluationCommandLineHandler handler, IComparable version, IProjectChangeDiff difference)
        {
            bool isActiveContext = true;
            var  logger          = IProjectDiagnosticOutputServiceFactory.Create();

            handler.ApplyProjectBuild(version, difference, isActiveContext, logger);
        }
示例#2
0
        private static void ApplyProjectEvaluation(AbstractEvaluationCommandLineHandler handler, IComparable version, IProjectChangeDiff difference, IImmutableDictionary <string, IImmutableDictionary <string, string> >?metadata = null)
        {
            metadata ??= ImmutableDictionary <string, IImmutableDictionary <string, string> > .Empty;
            var  previousMetadata = ImmutableDictionary <string, IImmutableDictionary <string, string> > .Empty;
            bool isActiveContext  = true;
            var  logger           = IProjectDiagnosticOutputServiceFactory.Create();

            handler.ApplyProjectEvaluation(version, difference, previousMetadata, metadata, isActiveContext, logger);
        }
示例#3
0
        public void ApplyProjectBuild_NullAsVersion_ThrowsArgumentNull()
        {
            var handler = CreateInstance();

            var difference = IProjectChangeDiffFactory.Create();
            var logger     = IProjectDiagnosticOutputServiceFactory.Create();

            Assert.Throws <ArgumentNullException>(() =>
            {
                handler.ApplyProjectBuild(null !, difference, true, logger);
            });
        }
示例#4
0
        public void ApplyProjectEvaluation_NullAsDifference_ThrowsArgumentNull()
        {
            var handler = CreateInstance();

            var version  = 1;
            var metadata = ImmutableDictionary <string, IImmutableDictionary <string, string> > .Empty;
            var logger   = IProjectDiagnosticOutputServiceFactory.Create();

            Assert.Throws <ArgumentNullException>(() =>
            {
                handler.ApplyProjectEvaluation(version, null !, metadata, metadata, true, logger);
            });
        }
示例#5
0
        private static PackageRestoreDataSource CreateInstance(UnconfiguredProject?project = null, IPackageRestoreUnconfiguredInputDataSource?dataSource = null, IVsSolutionRestoreService3?solutionRestoreService = null)
        {
            project ??= UnconfiguredProjectFactory.Create(IProjectThreadingServiceFactory.Create());
            dataSource ??= IPackageRestoreUnconfiguredInputDataSourceFactory.Create();
            IProjectAsynchronousTasksService projectAsynchronousTasksService = IProjectAsynchronousTasksServiceFactory.Create();

            solutionRestoreService ??= IVsSolutionRestoreServiceFactory.Create();
            IProjectDiagnosticOutputService logger = IProjectDiagnosticOutputServiceFactory.Create();
            IFileSystem fileSystem = IFileSystemFactory.Create();
            var         projectDependentFileChangeNotificationService = IProjectDependentFileChangeNotificationServiceFactory.Create();

            return(new PackageRestoreDataSource(
                       project,
                       dataSource,
                       projectAsynchronousTasksService,
                       solutionRestoreService,
                       fileSystem,
                       logger,
                       projectDependentFileChangeNotificationService));
        }
        private static ApplyChangesToWorkspaceContext CreateInstance(ConfiguredProject?project = null, ICommandLineParserService?commandLineParser = null, IProjectDiagnosticOutputService?logger = null, params IWorkspaceContextHandler[] handlers)
        {
            if (project == null)
            {
                var unconfiguredProject = UnconfiguredProjectFactory.ImplementFullPath(@"C:\Project\Project.csproj");

                project = ConfiguredProjectFactory.ImplementUnconfiguredProject(unconfiguredProject);
            }

            commandLineParser ??= ICommandLineParserServiceFactory.Create();
            logger ??= IProjectDiagnosticOutputServiceFactory.Create();

            var factories = handlers.Select(h => ExportFactoryFactory.ImplementCreateValueWithAutoDispose(() => h))
                            .ToArray();

            var applyChangesToWorkspaceContext = new ApplyChangesToWorkspaceContext(project, logger, factories);

            applyChangesToWorkspaceContext.CommandLineParsers.Add(commandLineParser);

            return(applyChangesToWorkspaceContext);
        }
        private static PackageRestoreDataSource CreateInstance(UnconfiguredProject?project = null, IPackageRestoreUnconfiguredInputDataSource?dataSource = null, IVsSolutionRestoreService3?solutionRestoreService = null)
        {
            project ??= UnconfiguredProjectFactory.CreateWithActiveConfiguredProjectProvider(IProjectThreadingServiceFactory.Create());
            dataSource ??= IPackageRestoreUnconfiguredInputDataSourceFactory.Create();
            IProjectAsynchronousTasksService projectAsynchronousTasksService = IProjectAsynchronousTasksServiceFactory.Create();

            solutionRestoreService ??= IVsSolutionRestoreServiceFactory.Create();
            IProjectDiagnosticOutputService logger = IProjectDiagnosticOutputServiceFactory.Create();
            IFileSystem fileSystem = IFileSystemFactory.Create();
            var         vsSolutionRestoreService4    = IVsSolutionRestoreService4Factory.ImplementRegisterRestoreInfoSourceAsync();
            var         sharedJoinableTaskCollection = new PackageRestoreSharedJoinableTaskCollection(IProjectThreadingServiceFactory.Create());

            return(new PackageRestoreDataSourceMocked(
                       project,
                       dataSource,
                       projectAsynchronousTasksService,
                       solutionRestoreService,
                       fileSystem,
                       logger,
                       vsSolutionRestoreService4,
                       sharedJoinableTaskCollection));
        }