예제 #1
0
        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 LaunchTargetValueProvider(project, settingsProvider, threadingService);

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

            Assert.Equal(expected: activeProfileLaunchTarget, actual: actualValue);
        }
예제 #2
0
        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 LaunchTargetValueProvider(project, settingsProvider, threadingService);

            await launchProfileProvider.OnSetPropertyValueAsync(string.Empty, "NewCommand", Mock.Of <IProjectProperties>());

            Assert.Equal(expected: "NewCommand", actual: activeProfileLaunchTarget);
        }