當前位置: 首頁>>代碼示例>>C#>>正文


C# Infrastructure.ApplicationInformation類代碼示例

本文整理匯總了C#中NuDeploy.Core.Common.Infrastructure.ApplicationInformation的典型用法代碼示例。如果您正苦於以下問題:C# ApplicationInformation類的具體用法?C# ApplicationInformation怎麽用?C# ApplicationInformation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ApplicationInformation類屬於NuDeploy.Core.Common.Infrastructure命名空間,在下文中一共展示了ApplicationInformation類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Program

        public Program(ApplicationInformation applicationInformation, IUserInterface userInterface, IActionLogger logger, ICommandLineArgumentInterpreter commandLineArgumentInterpreter, IHelpCommand helpCommand)
        {
            if (applicationInformation == null)
            {
                throw new ArgumentNullException("applicationInformation");
            }

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

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

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

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

            this.applicationInformation = applicationInformation;
            this.userInterface = userInterface;
            this.logger = logger;
            this.commandLineArgumentInterpreter = commandLineArgumentInterpreter;
            this.helpCommand = helpCommand;
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:33,代碼來源:Program.cs

示例2: AddOrUpdatePublishConfiguration_ConfigDoesNotYetExist_NewEntryIsPersisted

        public void AddOrUpdatePublishConfiguration_ConfigDoesNotYetExist_NewEntryIsPersisted()
        {
            // Arrange
            string configurationName = "Some Config Name";
            string publishLocation = "http://nuget.org/api/v2";
            string apiKey = Guid.NewGuid().ToString();

            var applicationInformation = new ApplicationInformation { ConfigurationFileFolder = Environment.CurrentDirectory };
            var publishConfigurationFactory = new Mock<IPublishConfigurationFactory>();
            var publishConfigurationPersistence = new Mock<IFilesystemPersistence<PublishConfiguration[]>>();

            var createdPublishConfiguration = new PublishConfiguration { Name = configurationName, PublishLocation = publishLocation, ApiKey = apiKey };
            publishConfigurationFactory.Setup(p => p.GetPublishConfiguration(configurationName, publishLocation, apiKey)).Returns(createdPublishConfiguration);

            var existingConfigurations = new PublishConfiguration[] { };
            publishConfigurationPersistence.Setup(p => p.Load(It.IsAny<string>())).Returns(existingConfigurations);

            var configFilePublishConfigurationAccessor = new ConfigFilePublishConfigurationAccessor(
                applicationInformation, publishConfigurationFactory.Object, publishConfigurationPersistence.Object);

            // Act
            configFilePublishConfigurationAccessor.AddOrUpdatePublishConfiguration(configurationName, publishLocation, apiKey);

            // Assert
            publishConfigurationPersistence.Verify(
                p => p.Save(It.Is<PublishConfiguration[]>(configs => configs.First().Equals(createdPublishConfiguration)), It.IsAny<string>()), Times.Once());
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:27,代碼來源:ConfigFilePublishConfigurationAccessorTests.cs

示例3: Constructor_AllParametersAreSet_ObjectIsInstantiated

        public void Constructor_AllParametersAreSet_ObjectIsInstantiated()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            var filesystemAccessor = new Mock<IFilesystemAccessor>();
            var packageConfigurationAccessor = new Mock<IPackageConfigurationAccessor>();
            var packageRepositoryBrowser = new Mock<IPackageRepositoryBrowser>();
            var powerShellExecutor = new Mock<IPowerShellExecutor>();
            var installationLogicProvider = new Mock<IInstallationLogicProvider>();
            var packageUninstaller = new Mock<IPackageUninstaller>();
            var nugetPackageExtractor = new Mock<INugetPackageExtractor>();
            var packageConfigurationTransformationService = new Mock<IPackageConfigurationTransformationService>();
            var configurationFileTransformationService = new Mock<IConfigurationFileTransformationService>();

            // Act
            var packageInstaller = new PackageInstaller(
                applicationInformation,
                filesystemAccessor.Object,
                packageConfigurationAccessor.Object,
                packageRepositoryBrowser.Object,
                powerShellExecutor.Object,
                installationLogicProvider.Object,
                packageUninstaller.Object,
                nugetPackageExtractor.Object,
                packageConfigurationTransformationService.Object,
                configurationFileTransformationService.Object);

            // Assert
            Assert.IsNotNull(packageInstaller);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:30,代碼來源:PackageInstallerTests.cs

示例4: SelfUpdateService

        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;
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:27,代碼來源:SelfUpdateService.cs

示例5: ActionLogger

        public ActionLogger(ApplicationInformation applicationInformation, IEncodingProvider encodingProvider)
        {
            this.applicationInformation = applicationInformation;
            this.logfileEncoding = encodingProvider.GetEncoding();

            this.logfilPath = this.GetLogfilePath();
            this.InitializeLogFile();
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:8,代碼來源:ActionLogger.cs

示例6: Constructor_UserInterfaceParametersIsNotSet_ArgumentNullExceptionIsThrown

        public void Constructor_UserInterfaceParametersIsNotSet_ArgumentNullExceptionIsThrown()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();

            // Act
            new HelpProvider(applicationInformation, null);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:8,代碼來源:HelpProviderTests.cs

示例7: Constructor_FilesystemAccessorParameterIsNull_ArgumentNullExceptionIsThrown

        public void Constructor_FilesystemAccessorParameterIsNull_ArgumentNullExceptionIsThrown()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            IFilesystemAccessor filesystemAccessor = null;

            // Act
            new PackagingFolderPathProvider(applicationInformation, filesystemAccessor);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:9,代碼來源:PackagingFolderPathProviderTests.cs

示例8: Constructor_SourceRepositoryConfigurationFactoryParametersIsNotSet_ArgumentNullExceptionIsThrown

        public void Constructor_SourceRepositoryConfigurationFactoryParametersIsNotSet_ArgumentNullExceptionIsThrown()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            var filesystemPersistence = new Mock<IFilesystemPersistence<SourceRepositoryConfiguration[]>>();

            // Act
            new ConfigFileSourceRepositoryProvider(applicationInformation, null, filesystemPersistence.Object);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:9,代碼來源:ConfigFileSourceRepositoryProviderTests.cs

示例9: RemoveAllFilesAndFoldersWhichAreCreatedOnStartup

        public static void RemoveAllFilesAndFoldersWhichAreCreatedOnStartup(ApplicationInformation applicationInformation)
        {
            DeleteFolder(applicationInformation.LogFolder);
            DeleteFolder(applicationInformation.BuildFolder);
            DeleteFolder(applicationInformation.PrePackagingFolder);
            DeleteFolder(applicationInformation.PackagingFolder);

            DeleteFiles("NuDeploy.*.config", applicationInformation.ConfigurationFileFolder);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:9,代碼來源:CoreIntegrationTestUtilities.cs

示例10: Constructor_PackageConfigurationAccessorParameterIsNull_ArgumentNullExceptionIsThrown

        public void Constructor_PackageConfigurationAccessorParameterIsNull_ArgumentNullExceptionIsThrown()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            IPackageConfigurationAccessor packageConfigurationAccessor = null;
            IFilesystemAccessor filesystemAccessor = new Mock<IFilesystemAccessor>().Object;

            // Act
            new InstallationStatusProvider(applicationInformation, packageConfigurationAccessor, filesystemAccessor);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:10,代碼來源:InstallationStatusProviderTests.cs

示例11: Constructor_UserInterfaceParametersIsNotSet_ArgumentNullExceptionIsThrown

        public void Constructor_UserInterfaceParametersIsNotSet_ArgumentNullExceptionIsThrown()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            var packageRepositoryBrowser = new Mock<IPackageRepositoryBrowser>();
            var filesystemAccessor = new Mock<IFilesystemAccessor>();

            // Act
            new SelfUpdateService(null, applicationInformation, packageRepositoryBrowser.Object, filesystemAccessor.Object);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:10,代碼來源:SelfUpdateServiceTests.cs

示例12: Constructor_HelpCommandParameterIsNotSet_ArgumentNullExceptionIsThrown

        public void Constructor_HelpCommandParameterIsNotSet_ArgumentNullExceptionIsThrown()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            var userInterface = new Mock<IUserInterface>();
            var logger = new Mock<IActionLogger>();
            var commandLineArgumentInterpreter = new Mock<ICommandLineArgumentInterpreter>();

            // Act
            new Program(applicationInformation, userInterface.Object, logger.Object, commandLineArgumentInterpreter.Object, null);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:11,代碼來源:ProgramTests.cs

示例13: Constructor_AllParametersAreSet_ObjectIsInstantiated

        public void Constructor_AllParametersAreSet_ObjectIsInstantiated()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            var userInterface = new Mock<IUserInterface>();

            // Act
            var helpProvider = new HelpProvider(applicationInformation, userInterface.Object);

            // Assert
            Assert.IsNotNull(helpProvider);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:12,代碼來源:HelpProviderTests.cs

示例14: Constructor_AllParametersAreSet_ObjectIsInstantiated

        public void Constructor_AllParametersAreSet_ObjectIsInstantiated()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            IFilesystemAccessor filesystemAccessor = new Mock<IFilesystemAccessor>().Object;

            // Act
            var result = new PackagingFolderPathProvider(applicationInformation, filesystemAccessor);

            // Arrange
            Assert.IsNotNull(result);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:12,代碼來源:PackagingFolderPathProviderTests.cs

示例15: Constructor_CommandAttributesAreInitializedProperly

        public void Constructor_CommandAttributesAreInitializedProperly()
        {
            // Arrange
            var applicationInformation = new ApplicationInformation();
            var selfUpdateService = new Mock<ISelfUpdateService>();
            var targetAssembly = new Mock<_Assembly>();

            // Act
            var selfupdateCommand = new SelfUpdateCommand(applicationInformation, selfUpdateService.Object, targetAssembly.Object);

            // Assert
            CommandTestUtilities.ValidateCommandAttributes(selfupdateCommand.Attributes);
        }
開發者ID:andreaskoch,項目名稱:NuDeploy,代碼行數:13,代碼來源:SelfUpdateCommandTests.cs


注:本文中的NuDeploy.Core.Common.Infrastructure.ApplicationInformation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。