예제 #1
0
        public SelfUpdateService(IUserInterface userInterface, ApplicationInformation applicationInformation, IPackageRepositoryBrowser packageRepositoryBrowser, IFilesystemAccessor filesystemAccessor)
        {
            if (userInterface == null)
            {
                throw new ArgumentNullException("userInterface");
            }

            if (applicationInformation == null)
            {
                throw new ArgumentNullException("applicationInformation");
            }

            if (packageRepositoryBrowser == null)
            {
                throw new ArgumentNullException("packageRepositoryBrowser");
            }

            if (filesystemAccessor == null)
            {
                throw new ArgumentNullException("filesystemAccessor");
            }

            this.userInterface = userInterface;
            this.applicationInformation = applicationInformation;
            this.packageRepositoryBrowser = packageRepositoryBrowser;
            this.filesystemAccessor = filesystemAccessor;
        }
        public void Setup()
        {
            var sourceRepositoryProviderMock = new Mock<ISourceRepositoryProvider>();
            sourceRepositoryProviderMock.Setup(r => r.GetRepositoryConfigurations()).Returns(
                new[] { new SourceRepositoryConfiguration { Name = "Default Nuget Repository", Url = NuDeployConstants.DefaultFeedUrl } });

            Func<Uri, IHttpClient> httpClientFactory = u => new RedirectedHttpClient(u);
            var packageRepositoryFactory = new CommandLineRepositoryFactory(httpClientFactory);

            this.packageRepositoryBrowser = new PackageRepositoryBrowser(sourceRepositoryProviderMock.Object, packageRepositoryFactory);
        }
예제 #3
0
        public PackageInstaller(ApplicationInformation applicationInformation, IFilesystemAccessor filesystemAccessor, IPackageConfigurationAccessor packageConfigurationAccessor, IPackageRepositoryBrowser packageRepositoryBrowser, IPowerShellExecutor powerShellExecutor, IInstallationLogicProvider installationLogicProvider, IPackageUninstaller packageUninstaller, INugetPackageExtractor nugetPackageExtractor, IPackageConfigurationTransformationService packageConfigurationTransformationService, IConfigurationFileTransformationService configurationFileTransformationService)
        {
            if (applicationInformation == null)
            {
                throw new ArgumentNullException("applicationInformation");
            }

            if (filesystemAccessor == null)
            {
                throw new ArgumentNullException("filesystemAccessor");
            }

            if (packageConfigurationAccessor == null)
            {
                throw new ArgumentNullException("packageConfigurationAccessor");
            }

            if (packageRepositoryBrowser == null)
            {
                throw new ArgumentNullException("packageRepositoryBrowser");
            }

            if (powerShellExecutor == null)
            {
                throw new ArgumentNullException("powerShellExecutor");
            }

            if (installationLogicProvider == null)
            {
                throw new ArgumentNullException("installationLogicProvider");
            }

            if (packageUninstaller == null)
            {
                throw new ArgumentNullException("packageUninstaller");
            }

            if (nugetPackageExtractor == null)
            {
                throw new ArgumentNullException("nugetPackageExtractor");
            }

            if (packageConfigurationTransformationService == null)
            {
                throw new ArgumentNullException("packageConfigurationTransformationService");
            }

            if (configurationFileTransformationService == null)
            {
                throw new ArgumentNullException("configurationFileTransformationService");
            }

            this.applicationInformation = applicationInformation;
            this.filesystemAccessor = filesystemAccessor;
            this.packageConfigurationAccessor = packageConfigurationAccessor;
            this.packageRepositoryBrowser = packageRepositoryBrowser;
            this.powerShellExecutor = powerShellExecutor;
            this.installationLogicProvider = installationLogicProvider;
            this.packageUninstaller = packageUninstaller;
            this.nugetPackageExtractor = nugetPackageExtractor;
            this.packageConfigurationTransformationService = packageConfigurationTransformationService;
            this.configurationFileTransformationService = configurationFileTransformationService;
        }