-
Notifications
You must be signed in to change notification settings - Fork 726
Testing
Terminal.Gui uses xunit for automated unit tests run automatically with Github Actions.
- Running tests in parallel is disabled because
Applicationis a singleton. Do not change those settings.
- Do. Please. Add lots.
- Structure the tests by class. Name the test classes in the form of
ClassNameTestsand the fileClassNameTests.cs. - The test functions themselves should have descriptive names like
TestBeginEnd. - IMPORTANT: Remember
Applicationis a static class (singleton). You must clean up after your tests by callingApplication.Shutdown.
See the README.md in UnitTests/ for details on how xunit is configured.
-
Every PR should include at least one update or addition to the existing Unit Tests. If you fixed a bug, figure out how to write a test that ensures it never regresses.
-
UICatalog is a great sample app for manual testing. When adding new functionality, fixing bugs, or changing things, please either add a new
Scenarioto UICatalog or update an existingScenarioto fully illustrate your work and provide a test-case. -
Ensure a UI Catalog Scenario has been developed that specifically exercises the code involved in the PR. This Scenario should explicitly and intentionally exercise the following common functional areas:
-
Absolute Positioning using constructors that take absolute coordinates (
Rect,x,y, etc...). -
Computed Positioning using constructors that do not take coordinates. Test various forms of computed positioning (e.g.
Pos.Percent,Pos.Y(view), etc...) and sizing (e.g.Dim.Fill, ...). -
Use the
All ViewsScenario to test Computed Positioning
-
-
Test on both Windows and Linux.
-
Run through every Scenario in
UI Catalogand look for regressions or broken behavior.- Resize terminal window to check for layout and clipping bugs.
- Drag
Windowswith the mouse looking for layout or clipping bugs. - Use
tabandshift-tabto ensure tab behavior has not broken.
-
Run
demo.cand ensure it has not broken (however, recognizing it's not a great sample any more).
Please edit this wiki with other regression tests you think of.