本文整理汇总了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;
}
示例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());
}
示例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);
}
示例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;
}
示例5: ActionLogger
public ActionLogger(ApplicationInformation applicationInformation, IEncodingProvider encodingProvider)
{
this.applicationInformation = applicationInformation;
this.logfileEncoding = encodingProvider.GetEncoding();
this.logfilPath = this.GetLogfilePath();
this.InitializeLogFile();
}
示例6: Constructor_UserInterfaceParametersIsNotSet_ArgumentNullExceptionIsThrown
public void Constructor_UserInterfaceParametersIsNotSet_ArgumentNullExceptionIsThrown()
{
// Arrange
var applicationInformation = new ApplicationInformation();
// Act
new HelpProvider(applicationInformation, null);
}
示例7: Constructor_FilesystemAccessorParameterIsNull_ArgumentNullExceptionIsThrown
public void Constructor_FilesystemAccessorParameterIsNull_ArgumentNullExceptionIsThrown()
{
// Arrange
var applicationInformation = new ApplicationInformation();
IFilesystemAccessor filesystemAccessor = null;
// Act
new PackagingFolderPathProvider(applicationInformation, filesystemAccessor);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}