Skip to content

main · v2.1 (preview)

Substituted controls and testers

Users · Reference · CurrentMarkdownAgent index

Status: Current. Reference for users. The rows of the tables are generated by docs/scripts/controls-table.mjs from the library sources and from the list of tester members in that script; npm test fails when the rows differ from its output or a tester is missing.

Each row names a type of the UI framework, the substitute class that replaces it, the kind of substitution, the tester that finds it by name, the testing events the substitute raises, including those it inherits from another substitute class, and the members the tester adds beyond Target and Handle. Test a Windows Forms application and Test an Avalonia application explain how to use them.

Allors.Immersive.Winforms substitutes 82 types of System.Windows.Forms, in the namespace Allors.Immersive.Winforms.Substitutes, with testers in Allors.Immersive.Winforms.Testers. The common dialogs, five of which are sealed, are substituted explicitly by classes that derive from CommonDialog; MessageBox is substituted through its static Show overloads. Every other substitute derives from the type it replaces.

Substituted typeSubstituteSubstitutionTesterEvents reportedTester members
System.Windows.Forms.BindingNavigatorBindingNavigatorBaseBindingNavigatorTesterAddNewItem()
System.Windows.Forms.ButtonButtonBaseButtonTesterClick, DoubleClickClick()
System.Windows.Forms.CheckBoxCheckBoxBaseCheckBoxTesterCheckedChanged
System.Windows.Forms.CheckedListBoxCheckedListBoxBaseCheckedListBoxTesterItemCheck
System.Windows.Forms.ColorDialogColorDialogExplicitColorDialogTesterShown
System.Windows.Forms.ComboBoxComboBoxBaseComboBoxTesterSelectedItemChangedSelect<T>(Predicate<T>)
System.Windows.Forms.ContextMenuContextMenuBaseContextMenuTester
System.Windows.Forms.ContextMenuStripContextMenuStripBaseContextMenuStripTester
System.Windows.Forms.DataGridDataGridBaseDataGridTester
System.Windows.Forms.DataGridTextBoxDataGridTextBoxBaseDataGridTextBoxTester
System.Windows.Forms.DataGridViewDataGridViewBaseDataGridViewTesterFindRow(predicate), FindRows(predicate)
System.Windows.Forms.DataGridViewComboBoxEditingControlDataGridViewComboBoxEditingControlBaseDataGridViewComboBoxEditingControlTester
System.Windows.Forms.DataGridViewRowDataGridViewRowBaseDataGridViewRowTester
System.Windows.Forms.DataGridViewTextBoxEditingControlDataGridViewTextBoxEditingControlBaseDataGridViewTextBoxEditingControlTester
System.Windows.Forms.DateTimePickerDateTimePickerBaseDateTimePickerTester
System.Windows.Forms.DomainUpDownDomainUpDownBaseDomainUpDownTester
System.Windows.Forms.ErrorProviderErrorProviderBaseErrorProviderTester
System.Windows.Forms.FileDialogFileDialogExplicit—Shown
System.Windows.Forms.FlowLayoutPanelFlowLayoutPanelBaseFlowLayoutPanelTester
System.Windows.Forms.FolderBrowserDialogFolderBrowserDialogExplicitFolderBrowserDialogTesterShown
System.Windows.Forms.FontDialogFontDialogExplicitFontDialogTesterShown
System.Windows.Forms.FormFormBaseFormTesterActivated, Shown
System.Windows.Forms.GroupBoxGroupBoxBaseGroupBoxTester
System.Windows.Forms.HScrollBarHScrollBarBaseHScrollBarTester
System.Windows.Forms.HelpProviderHelpProviderBaseHelpProviderTester
System.Windows.Forms.LabelLabelBaseLabelTester
System.Windows.Forms.LinkLabelLinkLabelBaseLinkLabelTester
System.Windows.Forms.ListBoxListBoxBaseListBoxTester
System.Windows.Forms.ListViewListViewBaseListViewTester
System.Windows.Forms.MainMenuMainMenuBaseMainMenuTester
System.Windows.Forms.MaskedTextBoxMaskedTextBoxBaseMaskedTextBoxTester
System.Windows.Forms.MenuItemMenuItemBaseMenuItemTesterClick()
System.Windows.Forms.MenuStripMenuStripBaseMenuStripTester
System.Windows.Forms.MessageBoxMessageBoxStatic Show overloadsMessageBoxTesterShown
System.Windows.Forms.MonthCalendarMonthCalendarBaseMonthCalendarTester
System.Windows.Forms.NumericUpDownNumericUpDownBaseNumericUpDownTester
System.Windows.Forms.OpenFileDialogOpenFileDialogExplicitOpenFileDialogTesterShown
System.Windows.Forms.PageSetupDialogPageSetupDialogExplicitPageSetupDialogTesterShown
System.Windows.Forms.PanelPanelBasePanelTester
System.Windows.Forms.PictureBoxPictureBoxBasePictureBoxTester
System.Windows.Forms.PrintDialogPrintDialogExplicitPrintDialogTesterShown
System.Windows.Forms.PrintPreviewControlPrintPreviewControlBasePrintPreviewControlTester
System.Windows.Forms.PrintPreviewDialogPrintPreviewDialogBasePrintPreviewDialogTester
System.Windows.Forms.ProgressBarProgressBarBaseProgressBarTester
System.Windows.Forms.PropertyGridPropertyGridBasePropertyGridTesterFindGridItem(params string[] names)
System.Windows.Forms.RadioButtonRadioButtonBaseRadioButtonTester
System.Windows.Forms.RichTextBoxRichTextBoxBaseRichTextBoxTester
System.Windows.Forms.SaveFileDialogSaveFileDialogExplicitSaveFileDialogTesterShown
System.Windows.Forms.SplitContainerSplitContainerBaseSplitContainerTester
System.Windows.Forms.SplitterSplitterBaseSplitterTester
System.Windows.Forms.StatusBarStatusBarBaseStatusBarTester
System.Windows.Forms.StatusBarPanelStatusBarPanelBaseStatusBarPanelTester
System.Windows.Forms.StatusStripStatusStripBaseStatusStripTester
System.Windows.Forms.TabControlTabControlBaseTabControlTester
System.Windows.Forms.TabPageTabPageBaseTabPageTester
System.Windows.Forms.TableLayoutPanelTableLayoutPanelBaseTableLayoutPanelTester
System.Windows.Forms.TextBoxTextBoxBaseTextBoxTester
System.Windows.Forms.TimerTimerBaseTimerTester
System.Windows.Forms.ToolBarToolBarBaseToolBarTesterClick(ToolBarButtonTester)
System.Windows.Forms.ToolBarButtonToolBarButtonBaseToolBarButtonTesterClick()
System.Windows.Forms.ToolStripToolStripBaseToolStripTester
System.Windows.Forms.ToolStripButtonToolStripButtonBaseToolStripButtonTesterClick()
System.Windows.Forms.ToolStripComboBoxToolStripComboBoxBaseToolStripComboBoxTester
System.Windows.Forms.ToolStripContainerToolStripContainerBaseToolStripContainerTester
System.Windows.Forms.ToolStripContentPanelToolStripContentPanelBaseToolStripContentPanelTester
System.Windows.Forms.ToolStripDropDownToolStripDropDownBaseToolStripDropDownTester
System.Windows.Forms.ToolStripDropDownButtonToolStripDropDownButtonBaseToolStripDropDownButtonTester
System.Windows.Forms.ToolStripDropDownMenuToolStripDropDownMenuBaseToolStripDropDownMenuTester
System.Windows.Forms.ToolStripLabelToolStripLabelBaseToolStripLabelTester
System.Windows.Forms.ToolStripMenuItemToolStripMenuItemBaseToolStripMenuItemTester
System.Windows.Forms.ToolStripPanelToolStripPanelBaseToolStripPanelTester
System.Windows.Forms.ToolStripProgressBarToolStripProgressBarBaseToolStripProgressBarTester
System.Windows.Forms.ToolStripSeparatorToolStripSeparatorBaseToolStripSeparatorTester
System.Windows.Forms.ToolStripSplitButtonToolStripSplitButtonBaseToolStripSplitButtonTester
System.Windows.Forms.ToolStripStatusLabelToolStripStatusLabelBaseToolStripStatusLabelTester
System.Windows.Forms.ToolStripTextBoxToolStripTextBoxBaseToolStripTextBoxTester
System.Windows.Forms.ToolTipToolTipBaseToolTipTester
System.Windows.Forms.TrackBarTrackBarBaseTrackBarTester
System.Windows.Forms.TreeViewTreeViewBaseTreeViewTesterNodeMouseClick, NodeMouseHoverSelectNode(params int[]), SelectNode(TreeNodeTester), FindNode(params int[]), SelectedNode, this[string[] ancestors]
System.Windows.Forms.UserControlUserControlBaseUserControlTester
System.Windows.Forms.VScrollBarVScrollBarBaseVScrollBarTester
System.Windows.Forms.WebBrowserWebBrowserBaseWebBrowserTester

Two testers address parts of a control rather than a control: GridItemTester, returned by PropertyGridTester.FindGridItem, with Value, Children and Edit(); and TreeNodeTester, returned by TreeViewTester.FindNode and its indexer, with Target, TreeViewTester, Select(), Click(), FindByTagType(Type) and an indexer for child nodes.

TestingWinformsEventKind lists many kinds of event, but the substitutes raise these nine: Activated, CheckedChanged, Click, DoubleClick, ItemCheck, NodeMouseClick, NodeMouseHover, SelectedItemChanged and Shown. Shown is raised by Form, by every common dialog from RunDialog, and by MessageBox.Show.

Allors.Immersive.Avalonia substitutes 49 controls of Avalonia.Controls, in the namespace Allors.Immersive.Avalonia.Substitutes, with testers in Allors.Immersive.Avalonia.Testers. Every substitute derives from the control it replaces and overrides StyleKeyOverride so that the theme still applies.

Substituted typeSubstituteSubstitutionTesterEvents reportedTester members
Avalonia.Controls.AutoCompleteBoxAutoCompleteBoxBaseAutoCompleteBoxTesterTextChanged
Avalonia.Controls.BorderBorderBaseBorderTester
Avalonia.Controls.ButtonButtonBaseButtonTesterClickClick()
Avalonia.Controls.CalendarCalendarBaseCalendarTesterSelectionChanged
Avalonia.Controls.CalendarDatePickerCalendarDatePickerBaseCalendarDatePickerTesterValueChanged
Avalonia.Controls.CanvasCanvasBaseCanvasTester
Avalonia.Controls.CarouselCarouselBaseCarouselTester
Avalonia.Controls.CheckBoxCheckBoxBaseCheckBoxTesterIsCheckedChanged
Avalonia.Controls.ComboBoxComboBoxBaseComboBoxTesterSelectionChanged
Avalonia.Controls.ContentControlContentControlBaseContentControlTester
Avalonia.Controls.ContextMenuContextMenuBaseContextMenuTester
Avalonia.Controls.DatePickerDatePickerBaseDatePickerTesterValueChanged
Avalonia.Controls.DockPanelDockPanelBaseDockPanelTester
Avalonia.Controls.ExpanderExpanderBaseExpanderTesterIsExpandedChanged
Avalonia.Controls.GridGridBaseGridTester
Avalonia.Controls.GridSplitterGridSplitterBaseGridSplitterTester
Avalonia.Controls.ImageImageBaseImageTester
Avalonia.Controls.ItemsControlItemsControlBaseItemsControlTester
Avalonia.Controls.LabelLabelBaseLabelTester
Avalonia.Controls.ListBoxListBoxBaseListBoxTesterSelectionChanged
Avalonia.Controls.ListBoxItemListBoxItemBaseListBoxItemTester
Avalonia.Controls.MenuMenuBaseMenuTester
Avalonia.Controls.MenuItemMenuItemBaseMenuItemTesterClickClick()
Avalonia.Controls.NumericUpDownNumericUpDownBaseNumericUpDownTesterValueChanged
Avalonia.Controls.PanelPanelBasePanelTester
Avalonia.Controls.ProgressBarProgressBarBaseProgressBarTesterValueChanged
Avalonia.Controls.RadioButtonRadioButtonBaseRadioButtonTesterIsCheckedChanged
Avalonia.Controls.RepeatButtonRepeatButtonBaseRepeatButtonTesterClickClick()
Avalonia.Controls.ScrollViewerScrollViewerBaseScrollViewerTester
Avalonia.Controls.SelectableTextBlockSelectableTextBlockBaseSelectableTextBlockTester
Avalonia.Controls.SeparatorSeparatorBaseSeparatorTester
Avalonia.Controls.SliderSliderBaseSliderTesterValueChanged
Avalonia.Controls.SplitButtonSplitButtonBaseSplitButtonTesterClickClick()
Avalonia.Controls.SplitViewSplitViewBaseSplitViewTester
Avalonia.Controls.StackPanelStackPanelBaseStackPanelTester
Avalonia.Controls.TabControlTabControlBaseTabControlTesterSelectionChanged
Avalonia.Controls.TabItemTabItemBaseTabItemTester
Avalonia.Controls.TextBlockTextBlockBaseTextBlockTester
Avalonia.Controls.TextBoxTextBoxBaseTextBoxTesterTextChanged
Avalonia.Controls.TimePickerTimePickerBaseTimePickerTesterValueChanged
Avalonia.Controls.Primitives.ToggleButtonToggleButtonBaseToggleButtonTesterClick, IsCheckedChangedClick()
Avalonia.Controls.ToggleSplitButtonToggleSplitButtonBaseToggleSplitButtonTesterClick, IsCheckedChangedClick()
Avalonia.Controls.ToggleSwitchToggleSwitchBaseToggleSwitchTesterIsCheckedChanged
Avalonia.Controls.TreeViewTreeViewBaseTreeViewTesterSelectionChanged
Avalonia.Controls.TreeViewItemTreeViewItemBaseTreeViewItemTester
Avalonia.Controls.UserControlUserControlBaseUserControlTester
Avalonia.Controls.ViewboxViewboxBaseViewboxTester
Avalonia.Controls.WindowWindowBaseWindowTesterClosed, Opened
Avalonia.Controls.WrapPanelWrapPanelBaseWrapPanelTester

TestingAvaloniaEventKind has eight kinds, all raised by substitutes: Click, Closed, IsCheckedChanged, IsExpandedChanged, Opened, SelectionChanged, TextChanged and ValueChanged.