NUnitForms Class Library

ControlTester.MouseController Method 

Returns a MouseController that can be used with the control under test. It would be better to use the MouseController on the base test class so that you don't have to worry about disposing it after your test. I think this may be marked obsolete soon.

[Visual Basic]
Public Function MouseController() As MouseController
[C#]
public MouseController MouseController();

Return Value

A MouseController.

Remarks

MouseController returns a new instance of a MouseController that can be used with the control under test. All mouse positions are relative the control.

The returned MouseController must be disposed to restore the mouse settings prior to the testing; which can be accomplished with the using statement.

Example

            TextBoxTester textBox = new TextBoxTester("myTextBox");
            using (MouseController mouse = textBox.MouseController())
            {
              mouse.Position = new PointF(1,1);
              mouse.Drag(30,1);
            }
            

See Also

ControlTester Class | NUnit.Extensions.Forms Namespace