예제 #1
0
        private static bool AskToCleanIfExists()
        {
            bool keepDirtyInstance = false;

            if (_visualStudioInstance.Exists() && !AbstractConsoleIntegrationTests.IsRunningOnBuildServer())
            {
                var instanceExists = $"The experimental instance '{_visualStudioInstance.VersionAndSuffix}' already exists.";
                var willReset      = "\nShould it be deleted before going on with the tests?";

                MessageBoxResult result = MessageBoxWithTimeout.Show(instanceExists + willReset, "Warning!", MessageBoxButton.YesNoCancel, MessageBoxResult.Cancel);
                switch (result)
                {
                case MessageBoxResult.Yes:
                    _visualStudioInstance.Clean();
                    break;

                case MessageBoxResult.No:
                    keepDirtyInstance = true;
                    break;

                case MessageBoxResult.Cancel:
                    Assert.Fail(instanceExists + " Didn't get confirmation to reset experimental instance. Cancelling...");
                    break;
                }
            }
            return(keepDirtyInstance);
        }
예제 #2
0
        private static void AskIfNotOnBuildServerAndProductiveVs(string suffix)
        {
            if (string.IsNullOrEmpty(suffix) &&
                _installIntoProductiveVs == null &&
                !AbstractConsoleIntegrationTests.IsRunningOnBuildServer())
            {
                MessageBoxResult result = MessageBoxWithTimeout.Show(
                    "Really launch tests? This will delete a potentially installed GoogleTestAdapter extension "
                    + "from your productive VisualStudio instance and install this build instead!",
                    "Warning!", MessageBoxButton.YesNoCancel, MessageBoxResult.Cancel);
                switch (result)
                {
                case MessageBoxResult.Yes:
                    _installIntoProductiveVs = true;
                    break;

                default:
                    _installIntoProductiveVs = false;
                    break;
                }
            }

            if (_installIntoProductiveVs.HasValue && !_installIntoProductiveVs.Value)
            {
                Assert.Inconclusive("Didn't get confirmation to execute tests. Cancelling...");
            }
        }