public async Task SqlDebugEnabled_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            bool activeProfileSqlDebugEnabled = false;
            var  activeProfileOtherSettings   = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.SqlDebuggingProperty, activeProfileSqlDebugEnabled }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                Assumes.NotNull(s.ActiveProfile?.OtherSettings);
                activeProfileSqlDebugEnabled = (bool)s.ActiveProfile.OtherSettings[LaunchProfileExtensions.SqlDebuggingProperty];
            });

            var project          = UnconfiguredProjectFactory.Create();
            var threadingService = IProjectThreadingServiceFactory.Create();
            var provider         = new ActiveLaunchProfileExtensionValueProvider(project, settingsProvider, threadingService);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.SqlDebuggingPropertyName, "true", Mock.Of <IProjectProperties>());

            Assert.True(activeProfileSqlDebugEnabled);
        }
        public async Task RemoteMachineName_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            string activeProfileRemoteMachineName = "Tiger";
            var    activeProfileOtherSettings     = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteDebugMachineProperty, activeProfileRemoteMachineName }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                Assumes.NotNull(s.ActiveProfile?.OtherSettings);
                activeProfileRemoteMachineName = (string)s.ActiveProfile.OtherSettings[LaunchProfileExtensions.RemoteDebugMachineProperty];
            });

            var project          = UnconfiguredProjectFactory.Create();
            var threadingService = IProjectThreadingServiceFactory.Create();
            var provider         = new ActiveLaunchProfileExtensionValueProvider(project, settingsProvider, threadingService);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.RemoteDebugMachinePropertyName, "Cheetah", Mock.Of <IProjectProperties>());

            Assert.Equal(expected: "Cheetah", actual: activeProfileRemoteMachineName);
        }
        public async Task SqlDebugEnabled_OnGetEvaluatedPropertyValueAsync_GetsSettingFromActiveProfile()
        {
            bool activeProfileSqlDebugEnabled = true;
            var  activeProfileOtherSettings   = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.SqlDebuggingProperty, activeProfileSqlDebugEnabled }
            };

            var settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "One", activeProfileOtherSettings: activeProfileOtherSettings);

            var provider = new ActiveLaunchProfileExtensionValueProvider(settingsProvider);

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

            Assert.Equal(expected: "true", actual: actualValue);
        }
        public async Task RemoteMachineName_OnGetEvaluatedPropertyValueAsync_GetsNameFromActiveProfile()
        {
            string activeProfileRemoteMachineName = "alphaMachine";
            var    activeProfileOtherSettings     = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteDebugMachineProperty, activeProfileRemoteMachineName }
            };

            var settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "One", activeProfileOtherSettings: activeProfileOtherSettings);

            var provider = new ActiveLaunchProfileExtensionValueProvider(settingsProvider);

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

            Assert.Equal(expected: activeProfileRemoteMachineName, actual: actualValue);
        }
        public async Task AuthenticationMode_OnGetEvaluatedPropertyValueAsync_GetsModeFromActiveProfile()
        {
            string activeProfileAuthenticationMode = "Windows";
            var    activeProfileOtherSettings      = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteAuthenticationModeProperty, activeProfileAuthenticationMode }
            };

            var settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "One", activeProfileOtherSettings: activeProfileOtherSettings);

            var provider = new ActiveLaunchProfileExtensionValueProvider(settingsProvider);

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

            Assert.Equal(expected: activeProfileAuthenticationMode, actual: actualValue);
        }
        public async Task RemoteDebugEnabled_OnGetEvaluatedPropertyValueAsync_GetsNativeDebuggingFromActiveProfile()
        {
            bool activeProfileRemoteDebugEnabled = true;
            var  activeProfileOtherSettings      = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteDebugEnabledProperty, activeProfileRemoteDebugEnabled }
            };

            var settingsProvider = SetupLaunchSettingsProvider(activeProfileName: "One", activeProfileOtherSettings: activeProfileOtherSettings);

            var project          = UnconfiguredProjectFactory.Create();
            var threadingService = IProjectThreadingServiceFactory.Create();
            var provider         = new ActiveLaunchProfileExtensionValueProvider(project, settingsProvider, threadingService);

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

            Assert.Equal(expected: "true", actual: actualValue);
        }
        public async Task RemoveDebugEnabled_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            bool activeProfileRemoteDebugEnabled = false;
            var  activeProfileOtherSettings      = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteDebugEnabledProperty, activeProfileRemoteDebugEnabled }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                Assumes.NotNull(s.ActiveProfile?.OtherSettings);
                activeProfileRemoteDebugEnabled = (bool)s.ActiveProfile.OtherSettings[LaunchProfileExtensions.RemoteDebugEnabledProperty];
            });

            var provider = new ActiveLaunchProfileExtensionValueProvider(settingsProvider);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.RemoteDebugEnabledPropertyName, "true", Mock.Of <IProjectProperties>());

            Assert.True(activeProfileRemoteDebugEnabled);
        }
        public async Task AuthenticationMode_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            string?activeProfileAuthenticationMode = "Windows";
            var    activeProfileOtherSettings      = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteAuthenticationModeProperty, activeProfileAuthenticationMode }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                Assumes.NotNull(s.ActiveProfile?.OtherSettings);
                activeProfileAuthenticationMode = (string)s.ActiveProfile.OtherSettings[LaunchProfileExtensions.RemoteAuthenticationModeProperty];
            });

            var provider = new ActiveLaunchProfileExtensionValueProvider(settingsProvider);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.AuthenticationModePropertyName, "NotWindows", Mock.Of <IProjectProperties>());

            Assert.Equal(expected: "NotWindows", actual: activeProfileAuthenticationMode);
        }
Exemplo n.º 9
0
        public async Task SqlDebugEnabled_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            bool activeProfileSqlDebugEnabled = false;
            var  activeProfileOtherSettings   = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.SqlDebuggingProperty, activeProfileSqlDebugEnabled }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                Assert.NotNull(s.ActiveProfile);
                Assert.True(s.ActiveProfile.TryGetSetting(LaunchProfileExtensions.SqlDebuggingProperty, out object?value));
                activeProfileSqlDebugEnabled = (bool)value;
            });

            var provider = new ActiveLaunchProfileExtensionValueProvider(settingsProvider);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.SqlDebuggingPropertyName, "true", Mock.Of <IProjectProperties>());

            Assert.True(activeProfileSqlDebugEnabled);
        }
Exemplo n.º 10
0
        public async Task RemoteMachineName_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            string activeProfileRemoteMachineName = "Tiger";
            var    activeProfileOtherSettings     = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteDebugMachineProperty, activeProfileRemoteMachineName }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                Assert.NotNull(s.ActiveProfile);
                Assert.True(s.ActiveProfile.TryGetSetting(LaunchProfileExtensions.RemoteDebugMachineProperty, out object?value));
                activeProfileRemoteMachineName = (string)value;
            });

            var provider = new ActiveLaunchProfileExtensionValueProvider(settingsProvider);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.RemoteDebugMachinePropertyName, "Cheetah", Mock.Of <IProjectProperties>());

            Assert.Equal(expected: "Cheetah", actual: activeProfileRemoteMachineName);
        }
        public async Task NativeDebugging_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            bool activeProfileNativeDebugging = false;
            var  activeProfileOtherSettings   = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteAuthenticationModeProperty, activeProfileNativeDebugging }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                activeProfileNativeDebugging = (bool)s.ActiveProfile !.OtherSettings[LaunchProfileExtensions.NativeDebuggingProperty];
            });

            var project          = UnconfiguredProjectFactory.Create();
            var threadingService = IProjectThreadingServiceFactory.Create();
            var provider         = new ActiveLaunchProfileExtensionValueProvider(project, settingsProvider, threadingService);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.NativeDebuggingPropertyName, "true", Mock.Of <IProjectProperties>());

            Assert.True(activeProfileNativeDebugging);
        }
        public async Task AuthenticationMode_OnSetPropertyValueAsync_SetsDirectoryInActiveProfile()
        {
            string activeProfileAuthenticationMode = "Windows";
            var    activeProfileOtherSettings      = new Dictionary <string, object>
            {
                { LaunchProfileExtensions.RemoteAuthenticationModeProperty, activeProfileAuthenticationMode }
            };

            var settingsProvider = SetupLaunchSettingsProvider(
                activeProfileName: "One",
                activeProfileOtherSettings: activeProfileOtherSettings,
                updateLaunchSettingsCallback: s =>
            {
                activeProfileAuthenticationMode = (string)s.ActiveProfile !.OtherSettings[LaunchProfileExtensions.RemoteAuthenticationModeProperty];
            });

            var project          = UnconfiguredProjectFactory.Create();
            var threadingService = IProjectThreadingServiceFactory.Create();
            var provider         = new ActiveLaunchProfileExtensionValueProvider(project, settingsProvider, threadingService);

            await provider.OnSetPropertyValueAsync(ActiveLaunchProfileExtensionValueProvider.AuthenticationModePropertyName, "NotWindows", Mock.Of <IProjectProperties>());

            Assert.Equal(expected: "NotWindows", actual: activeProfileAuthenticationMode);
        }