/// <summary> /// Clean up any resources being used. /// </summary> protected virtual void Dispose(bool disposing) { if (disposing) { if (optionsPageGeneral != null) { optionsPageGeneral = null; } GC.SuppressFinalize(this); } }
public void OptionsPageGeneralTestInitialize() { testString = "This is the test string."; tmpImgFilePath = AppDomain.CurrentDomain.BaseDirectory + Path.DirectorySeparatorChar + tmpImgFilePath; optionsPageGeneral = new OptionsPageGeneral(); optionsPageGeneralAccessor = new Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsPageGeneralAccessor(optionsPageGeneral); // to forbid display of MessageBoxes WinFormsHelper.AllowMessageBox = false; }
public void OnDeactivateTest() { OptionsPageGeneral target = new OptionsPageGeneral(); Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsPageGeneralAccessor accessor = optionsPageGeneralAccessor; CancelEventArgs cancelEventArgs = new CancelEventArgs(false); // we simulate Cancel button choice, in this case we expect that // cancelEventArgs.Cancel was switched to the true state. WinFormsHelper.FakeDialogResult = DialogResult.Cancel; accessor.OnDeactivate(cancelEventArgs); Assert.IsTrue(cancelEventArgs.Cancel, "CancelEventArgs Cancel property was initialized by not expected value in case when simulated Cancel button choice."); }
public void OptionsPageGeneralTestCleanup() { optionsPageGeneral = null; Dispose(); }
public void OnClosedTest() { OptionsPageGeneral target = new OptionsPageGeneral(); Microsoft_Samples_VisualStudio_IDE_OptionsPage_OptionsPageGeneralAccessor accessor = optionsPageGeneralAccessor; EventArgs e = null; accessor.OnClosed(e); }