private static void AskIfNotOnBuildServerAndProductiveVs(string suffix) { if (string.IsNullOrEmpty(suffix) && _installIntoProductiveVs == null && !CiSupport.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..."); } }
private bool AskToCleanIfExists() { bool keepDirtyInstance = false; if (VisualStudioInstance.Exists() && !CiSupport.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); }
public static DialogResult ShowQuestionWithTimeout(string txtMessage, string txtCaption, uint timeOutMS) { return(MessageBoxWithTimeout.Show(txtMessage, txtCaption, MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, timeOutMS)); }