public async Task WorkingDirectory_OnGetUnevaluatedPropertyValueAsync_GetsDirectoryFromActiveProfile()
        {
            string activeProfileWorkingDirectory = @"C:\delta\epsilon\phi";
            var    settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "Two", activeProfileWorkingDirectory: activeProfileWorkingDirectory);

            var workingDirectoryProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider);

            var actualValue = await workingDirectoryProvider.OnGetUnevaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.WorkingDirectoryPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileWorkingDirectory, actual: actualValue);
        }
        public async Task LaunchTarget_OnGetEvaluatedPropertyValueAsync_GetsTargetFromActiveProfile()
        {
            string activeProfileLaunchTarget = "AlphaCommand";
            var    settingsProvider          = SetupLaunchSettingsProvider(activeProfileName: "Alpha", activeProfileLaunchTarget: activeProfileLaunchTarget);

            var launchProfileProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider);

            var actualValue = await launchProfileProvider.OnGetEvaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchTargetPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileLaunchTarget, actual: actualValue);
        }
        public async Task CommandLineArguments_OnGetUnevaluatedPropertyValueAsync_GetsArgumentsFromActiveProfile()
        {
            string activeProfileCommandLineArguments = "/alpaca:YES /llama:NO /vicuña:NONONO";
            var    settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "SortOfFarmAnimals", activeProfileCommandLineArgs: activeProfileCommandLineArguments);

            var commandLineArgumentsProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider);

            var actualValue = await commandLineArgumentsProvider.OnGetUnevaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.CommandLineArgumentsPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileCommandLineArguments, actual: actualValue);
        }
        public async Task ExecutablePath_OnGetUnevaluatedPropertyValueAsync_GetsExecutableFromActiveProfile()
        {
            string activeProfileExecutablePath = @"C:\user\bin\beta.exe";
            var    settingsProvider            = SetupLaunchSettingsProvider(activeProfileName: "Beta", activeProfileExecutablePath: activeProfileExecutablePath);

            var launchProfileProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider);

            var actualValue = await launchProfileProvider.OnGetUnevaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.ExecutablePathPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileExecutablePath, actual: actualValue);
        }
        public async Task LaunchUrl_OnGetEvaluatedPropertyValueAsync_GetsUrlFromActiveProfile()
        {
            string activeProfileLaunchUrl = "https://microsoft.com";
            var    settingsProvider       = SetupLaunchSettingsProvider(activeProfileName: "One", activeProfileLaunchUrl: activeProfileLaunchUrl);

            var workingDirectoryProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider);

            var actualValue = await workingDirectoryProvider.OnGetEvaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchUrlPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileLaunchUrl, actual: actualValue);
        }
        public async Task LaunchBrowser_OnGetEvaluatedPropertyValueAsync_GetsValueFromActiveProfile()
        {
            bool activeProfileLaunchBrowser = true;
            var  settingsProvider           = SetupLaunchSettingsProvider(activeProfileName: "One", activeProfileLaunchBrowser: activeProfileLaunchBrowser);

            var workingDirectoryProvider = new ActiveLaunchProfileCommonValueProvider(settingsProvider);

            var actualValue = await workingDirectoryProvider.OnGetEvaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchBrowserPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: "true", actual: actualValue);
        }
        public async Task LaunchTarget_OnGetUnevaluatedPropertyValueAsync_GetsTargetFromActiveProfile()
        {
            string activeProfileLaunchTarget = "BetaCommand";
            var    settingsProvider          = SetupLaunchSettingsProvider(activeProfileName: "Beta", activeProfileLaunchTarget: activeProfileLaunchTarget);

            var project               = UnconfiguredProjectFactory.Create();
            var threadingService      = IProjectThreadingServiceFactory.Create();
            var launchProfileProvider = new ActiveLaunchProfileCommonValueProvider(project, settingsProvider, threadingService);

            var actualValue = await launchProfileProvider.OnGetEvaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.LaunchTargetPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileLaunchTarget, actual: actualValue);
        }
        public async Task ExecutablePath_OnGetEvaluatedPropertyValueAsync_GetsExecutableFromActiveProfile()
        {
            string activeProfileExecutablePath = @"C:\user\bin\alpha.exe";
            var    settingsProvider            = SetupLaunchSettingsProvider(activeProfileName: "Alpha", activeProfileExecutablePath: activeProfileExecutablePath);

            var project               = UnconfiguredProjectFactory.Create();
            var threadingService      = IProjectThreadingServiceFactory.Create();
            var launchProfileProvider = new ActiveLaunchProfileCommonValueProvider(project, settingsProvider, threadingService);

            var actualValue = await launchProfileProvider.OnGetEvaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.ExecutablePathPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileExecutablePath, actual: actualValue);
        }
        public async Task WorkingDirectory_OnGetEvaluatedPropertyValueAsync_GetsDirectoryFromActiveProfile()
        {
            string activeProfileWorkingDirectory = @"C:\alpha\beta\gamma";
            var    settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "One", activeProfileWorkingDirectory: activeProfileWorkingDirectory);

            var project                  = UnconfiguredProjectFactory.Create();
            var threadingService         = IProjectThreadingServiceFactory.Create();
            var workingDirectoryProvider = new ActiveLaunchProfileCommonValueProvider(project, settingsProvider, threadingService);

            var actualValue = await workingDirectoryProvider.OnGetEvaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.WorkingDirectoryPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileWorkingDirectory, actual: actualValue);
        }
        public async Task CommandLineArguments_OnGetEvaluatedPropertyValueAsync_GetsArgumentsFromActiveProfile()
        {
            string activeProfileCommandLineArguments = "/bird:YES /giraffe:NO";
            var    settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "ZooAnimals", activeProfileCommandLineArgs: activeProfileCommandLineArguments);

            var project                      = UnconfiguredProjectFactory.Create();
            var threadingService             = IProjectThreadingServiceFactory.Create();
            var commandLineArgumentsProvider = new ActiveLaunchProfileCommonValueProvider(project, settingsProvider, threadingService);

            var actualValue = await commandLineArgumentsProvider.OnGetEvaluatedPropertyValueAsync(ActiveLaunchProfileCommonValueProvider.CommandLineArgumentsPropertyName, string.Empty, Mock.Of <IProjectProperties>());

            Assert.Equal(expected: activeProfileCommandLineArguments, actual: actualValue);
        }
        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 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 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 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);
        }
        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);
        }