コード例 #1
0
        public async Task ExecutablePath_OnGetUnevaluatedPropertyValueAsync_GetsExecutableFromActiveProfile()
        {
            string activeProfileExecutablePath = @"C:\user\bin\beta.exe";
            var    settingsProvider            = SetupLaunchSettingsProvider(activeProfileName: "Beta", activeProfileExecutablePath: activeProfileExecutablePath);

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

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

            Assert.Equal(expected: activeProfileExecutablePath, actual: actualValue);
        }
コード例 #2
0
        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 project               = UnconfiguredProjectFactory.Create();
            var threadingService      = IProjectThreadingServiceFactory.Create();
            var launchProfileProvider = new ExecutablePathValueProvider(project, settingsProvider, threadingService);

            await launchProfileProvider.OnSetPropertyValueAsync(string.Empty, @"C:\user\bin\delta.exe", Mock.Of <IProjectProperties>());

            Assert.Equal(expected: @"C:\user\bin\delta.exe", actual: activeProfileExecutablePath);
        }