public async Task AbsoluteRootPathAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues(); var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(RemoveTrailingSeparator(projectPath), await project.GetAbsoluteRootPathAsync()); }
public static void Initialize() { CodeProjectHelper = new Projects.CodeProjectHelper(); mProjectValues = new ProjectValues(); FacadeContainer.Self.ProjectValues = mProjectValues; VerificationId = 0; }
public async Task GetGgpApplicationAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpApplication = "GGP App Name", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(projectValues.GgpApplication, await project.GetApplicationAsync()); }
public async Task GetGgpCustomDeployOnLaunchAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpCustomDeployOnLaunch = "GGP Launch Command", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(projectValues.GgpCustomDeployOnLaunch, await project.GetCustomDeployOnLaunchAsync()); }
public async Task CreateConfiguredProjectInvalidDeployOnLaunchAsync() { var projectPath = @"C:\Yeti_project_path\"; var projectValues = new ProjectValues { GgpDeployOnLaunch = "invalid_bool", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); var project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(DeployOnLaunchSetting.DELTA, await project.GetDeployOnLaunchAsync()); }
VCProject CreateVcMsBuildProject(ProjectValues projectValues, string projectPath) { var project = CreateVcProject(projectValues, projectPath); project.ActiveConfiguration.ConfigurationType.Returns( ConfigurationTypes.typeApplication); var generalRule = (IVCRulePropertyStorage)project.ActiveConfiguration.Rules .Item("ConfigurationGeneral"); generalRule.GetEvaluatedPropertyValue("TargetName").Returns(projectValues.TargetName); return(project); }
VCProject CreateVcMakefileProject(ProjectValues projectValues, string projectPath) { var project = CreateVcProject(projectValues, projectPath); project.ActiveConfiguration.ConfigurationType.Returns( ConfigurationTypes.typeUnknown); var nmakeRule = Substitute.For <IVCRulePropertyStorage>(); nmakeRule.GetEvaluatedPropertyValue("NMakeOutput").Returns(projectValues.TargetName); project.ActiveConfiguration.Rules.Item("ConfigurationNMake").Returns(nmakeRule); return(project); }
public async Task GetQueryParamsAsync() { var projectPath = @"C:\Yeti_project_path\"; var projectValues = new ProjectValues { GgpQueryParams = "test1=5&test2=10" }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); var project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(await project.GetQueryParamsAsync(), projectValues.GgpQueryParams); }
public async Task GetGgpGameletEnvironmentVariablesAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpGameletEnvironmentVariables = "GGP Env Vars", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(projectValues.GgpGameletEnvironmentVariables, await project.GetGameletEnvironmentVariablesAsync()); }
public async Task GetGgpLaunchRgpAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpLaunchRgp = "true", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.True(await project.GetLaunchRgpAsync()); }
public async Task GetGgpEndpointAsync() { const string projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpEndpoint = "Test Client", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(StadiaEndpoint.TestClient, await project.GetEndpointAsync()); }
public async Task GetGgpTestAccountAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpTestAccount = "GGP Test Account", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(projectValues.GgpTestAccount, await project.GetTestAccountAsync()); }
public async Task CreateConfiguredProjectInvalidLaunchRgpAsync() { var projectPath = @"C:\Yeti_project_path\"; var projectValues = new ProjectValues { GgpLaunchRgp = "invald_bool", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); var project = new ConfiguredProjectAdapter(configuredProject); Assert.False(await project.GetLaunchRgpAsync()); }
public async Task GetOutputDirectoryEmptyAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { OutDir = @"", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(RemoveTrailingSeparator(projectValues.OutDir), await project.GetOutputDirectoryAsync()); }
public async Task GetGgpDeployOnLaunchAsync(string stringValue, DeployOnLaunchSetting enumValue) { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpDeployOnLaunch = stringValue, }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(enumValue, await project.GetDeployOnLaunchAsync()); }
public async Task CreateConfiguredProjectInvalidInstanceSurfaceEnforcementAsync() { var projectPath = string.Empty; var projectValues = new ProjectValues { GgpSurfaceEnforcementMode = "invalid_setting", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); var project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(SurfaceEnforcementSetting.Off, await project.GetSurfaceEnforcementAsync()); }
public async Task GetGgpVulkanDriverVariantAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { GgpVulkanDriverVariant = "optprintasserts", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(projectValues.GgpVulkanDriverVariant, await project.GetVulkanDriverVariantAsync()); }
public async Task GetExecutablePathAsync() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { ExecutablePath = @"C:\GGP_exe_path\", }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(RemoveTrailingSeparator(projectValues.ExecutablePath), await project.GetExecutablePathAsync()); }
public void CreateVcProjectInvalidVcProject() { var projectPath = @"C:\Yeti_project_path\"; var projectValues = new ProjectValues(); var vcProject = CreateVcProject(projectValues, projectPath); vcProject.ActiveConfiguration.Rules.Item("ConfigurationGeneral") .Throws(new COMException("")); var project = vcProjectAdapterFactory.Create(vcProject); Assert.IsNull(project); }
public async Task GetGgpSurfaceEnforcementModeAsync( SurfaceEnforcementSetting surfaceEnforcement) { var projectPath = string.Empty; var projectValues = new ProjectValues { GgpSurfaceEnforcementMode = surfaceEnforcement.ToString() }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(surfaceEnforcement, await project.GetSurfaceEnforcementAsync()); }
public void GetOutputDirectoryEmpty() { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { OutDir = @"", }; var vcProject = CreateVcProject(projectValues, projectPath); ISolutionExplorerProject project = vcProjectAdapterFactory.Create(vcProject); Assert.AreEqual(RemoveTrailingSeparator(projectPath), project.OutputDirectory); }
public async Task GetTargetFilenameEmptyAsync() { var projectPath = @"C:\GGP_project_path\"; var targetFileName = @""; var targetDirectory = @"C:\GGP\"; var projectValues = new ProjectValues { TargetPath = Path.Combine(targetDirectory, targetFileName), }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(targetFileName, await project.GetTargetFileNameAsync()); }
VCProject CreateVcProject(ProjectValues projectValues, string projectPath) { var configuration = Substitute.For <VCConfiguration>(); var project = Substitute.For <VCProject>(); project.ProjectDirectory.Returns(projectPath); project.ActiveConfiguration.Returns(configuration); var generalRule = Substitute.For <IVCRulePropertyStorage>(); generalRule.GetEvaluatedPropertyValue("TargetPath").Returns(projectValues.TargetPath); generalRule.GetEvaluatedPropertyValue("OutDir").Returns(projectValues.OutDir); configuration.Rules.Item("ConfigurationGeneral").Returns(generalRule); return(project); }
public void GetTargetDirectoryMakefileProject(string targetPath, string targetFileName, string expected) { var projectPath = @"C:\GGP_project_path\"; var projectValues = new ProjectValues { TargetPath = targetPath, TargetName = targetFileName, }; var vcProject = CreateVcMakefileProject(projectValues, projectPath); ISolutionExplorerProject project = vcProjectAdapterFactory.Create(vcProject); Assert.AreEqual(expected, project.TargetDirectory); }
public async Task GetTargetDirectoryAsync() { var projectPath = @"C:\GGP_project_path\"; var targetFileName = @"GGP_executable.elf"; var targetDirectory = @"C:\GGP\"; var projectValues = new ProjectValues { TargetPath = Path.Combine(targetDirectory, targetFileName), }; var configuredProject = CreateConfiguredProject(projectValues, projectPath); IAsyncProject project = new ConfiguredProjectAdapter(configuredProject); Assert.AreEqual(RemoveTrailingSeparator(targetDirectory), await project.GetTargetDirectoryAsync()); }
ConfiguredProject CreateConfiguredProject(ProjectValues projectValues, string projectPath) { var project = CreateConfiguredProjectBase(); var userProperties = Substitute.For<IProjectProperties>(); var userPropertiesProvider = Substitute.For<IProjectPropertiesProvider>(); var projectProperties = Substitute.For<IProjectProperties>(); var projectPropertiesProvider = Substitute.For<IProjectPropertiesProvider>(); project.UnconfiguredProject.FullPath.Returns(projectPath); project.Services.UserPropertiesProvider.Returns(userPropertiesProvider); userPropertiesProvider.GetCommonProperties().Returns(userProperties); project.Services.ProjectPropertiesProvider.Returns(projectPropertiesProvider); projectPropertiesProvider.GetCommonProperties().Returns(projectProperties); userProperties.GetEvaluatedPropertyValueAsync("GgpGameletLaunchArguments") .Returns(projectValues.GgpGameletLaunchArguments); userProperties.GetEvaluatedPropertyValueAsync("GgpGameletEnvironmentVariables") .Returns(projectValues.GgpGameletEnvironmentVariables); userProperties.GetEvaluatedPropertyValueAsync("GgpApplication") .Returns(projectValues.GgpApplication); userProperties.GetEvaluatedPropertyValueAsync("GgpDeployOnLaunch") .Returns(projectValues.GgpDeployOnLaunch); userProperties.GetEvaluatedPropertyValueAsync("GgpSurfaceEnforcementMode") .Returns(projectValues.GgpSurfaceEnforcementMode); userProperties.GetEvaluatedPropertyValueAsync("GgpCustomDeployOnLaunch") .Returns(projectValues.GgpCustomDeployOnLaunch); userProperties.GetEvaluatedPropertyValueAsync("GgpLaunchRenderDoc") .Returns(projectValues.GgpLaunchRenderDoc); userProperties.GetEvaluatedPropertyValueAsync("GgpLaunchRgp") .Returns(projectValues.GgpLaunchRgp); userProperties.GetEvaluatedPropertyValueAsync("GgpVulkanDriverVariant") .Returns(projectValues.GgpVulkanDriverVariant); userProperties.GetEvaluatedPropertyValueAsync("GgpTestAccount") .Returns(projectValues.GgpTestAccount); userProperties.GetEvaluatedPropertyValueAsync("TargetPath") .Returns(projectValues.TargetPath); userProperties.GetEvaluatedPropertyValueAsync("OutDir").Returns(projectValues.OutDir); userProperties.GetEvaluatedPropertyValueAsync("GgpQueryParams") .Returns(projectValues.GgpQueryParams); projectProperties.GetEvaluatedPropertyValueAsync("ExecutablePath") .Returns(projectValues.ExecutablePath); return project; }