public async Task LaunchUrl_OnSetPropertyValueAsync_SetsUrlInActiveProfile() { string?activeProfileLaunchUrl = "https://incorrect.com"; var settingsProvider = SetupLaunchSettingsProvider( activeProfileName: "Three", activeProfileLaunchUrl: activeProfileLaunchUrl, updateLaunchSettingsCallback: s => { activeProfileLaunchUrl = s.ActiveProfile !.LaunchUrl; }); var workingDirectoryProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider); await workingDirectoryProvider.OnSetPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchUrlPropertyName, "https://microsoft.com", Mock.Of <IProjectProperties>()); Assert.Equal(expected: "https://microsoft.com", actual: activeProfileLaunchUrl); }
public async Task ExecutablePath_OnSetPropertyValueAsync_SetsTargetInActiveProfile() { string?activeProfileExecutablePath = @"C:\user\bin\gamma.exe"; var settingsProvider = SetupLaunchSettingsProvider( activeProfileName: "Gamma", activeProfileExecutablePath: activeProfileExecutablePath, updateLaunchSettingsCallback: s => { activeProfileExecutablePath = s.ActiveProfile !.ExecutablePath; }); var launchProfileProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider); await launchProfileProvider.OnSetPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.ExecutablePathPropertyName, @"C:\user\bin\delta.exe", Mock.Of <IProjectProperties>()); Assert.Equal(expected: @"C:\user\bin\delta.exe", actual: activeProfileExecutablePath); }
public async Task LaunchBrowser_OnSetPropertyValueAsync_SetsValueInActiveProfile() { bool activeProfileLaunchBrowser = false; var settingsProvider = SetupLaunchSettingsProvider( activeProfileName: "Three", activeProfileLaunchBrowser: activeProfileLaunchBrowser, updateLaunchSettingsCallback: s => { activeProfileLaunchBrowser = s.ActiveProfile !.LaunchBrowser; }); var workingDirectoryProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider); await workingDirectoryProvider.OnSetPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchBrowserPropertyName, "true", Mock.Of <IProjectProperties>()); Assert.True(activeProfileLaunchBrowser); }
public async Task LaunchTarget_OnSetPropertyValueAsync_SetsTargetInActiveProfile() { string?activeProfileLaunchTarget = "GammaCommand"; var settingsProvider = SetupLaunchSettingsProvider( activeProfileName: "Gamma", activeProfileLaunchTarget, updateLaunchSettingsCallback: s => { activeProfileLaunchTarget = s.ActiveProfile !.CommandName; }); var launchProfileProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider); await launchProfileProvider.OnSetPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchTargetPropertyName, "NewCommand", Mock.Of <IProjectProperties>()); Assert.Equal(expected: "NewCommand", actual: activeProfileLaunchTarget); }
public async Task WorkingDirectory_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile() { string?activeProfileWorkingDirectory = @"C:\one\two\three"; var settingsProvider = SetupLaunchSettingsProvider( activeProfileName: "Three", activeProfileWorkingDirectory: activeProfileWorkingDirectory, updateLaunchSettingsCallback: s => { activeProfileWorkingDirectory = s.ActiveProfile !.WorkingDirectory; }); var project = UnconfiguredProjectFactory.Create(); var threadingService = IProjectThreadingServiceFactory.Create(); var workingDirectoryProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider); await workingDirectoryProvider.OnSetPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.WorkingDirectoryPropertyName, @"C:\four\five\six", Mock.Of <IProjectProperties>()); Assert.Equal(expected: @"C:\four\five\six", actual: activeProfileWorkingDirectory); }
public async Task CommandLineArguments_OnSetPropertyValueAsync_SetsArgumentsInActiveProfile() { string?activeProfileCommandLineArgs = "/orca:YES /bluewhale:NO"; var settingsProvider = SetupLaunchSettingsProvider( activeProfileName: "SeaMammals", activeProfileCommandLineArgs: activeProfileCommandLineArgs, updateLaunchSettingsCallback: s => { activeProfileCommandLineArgs = s.ActiveProfile !.CommandLineArgs; }); var project = UnconfiguredProjectFactory.Create(); var threadingService = IProjectThreadingServiceFactory.Create(); var commandLineArgumentsProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider); await commandLineArgumentsProvider.OnSetPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.CommandLineArgumentsPropertyName, "/seaotters:YES /seals:YES", Mock.Of <IProjectProperties>()); Assert.Equal(expected: "/seaotters:YES /seals:YES", actual: activeProfileCommandLineArgs); }
public async Task LaunchTarget_OnSetPropertyValueAsync_SetsTargetInActiveProfile() { string activeProfileLaunchTarget = "GammaCommand"; var settingsProvider = SetupLaunchSettingsProvider( activeProfileName: "Gamma", activeProfileLaunchTarget, updateLaunchSettingsCallback: s => { activeProfileLaunchTarget = s.ActiveProfile !.CommandName; }); var project = UnconfiguredProjectFactory.Create(); var threadingService = IProjectThreadingServiceFactory.Create(); var launchProfileProvider = new ActiveLaunchProfileCommonValueProvider(project, settingsProvider, threadingService); await launchProfileProvider.OnSetPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchTargetPropertyName, "NewCommand", Mock.Of <IProjectProperties>()); Assert.Equal(expected: "NewCommand", actual: activeProfileLaunchTarget); }