当前位置: 首页>>代码示例>>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;未经允许,请勿转载。