Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When invoking "run test(s)" in abstract class, ask which concrete subclass to use #207

Open
dstango opened this issue Dec 19, 2023 · 0 comments

Comments

@dstango
Copy link
Contributor

dstango commented Dec 19, 2023

Consider a setup in which there is an abstract base class that contains some tests, and one or several concrete subclasses, that setup different test fixtures for the tests. Examples: selenium tests for different browsers, tests to be executed against differing databases, alternative implementations for a common interface.

Currently it's not possible be in that abstract base class and invoke a single test, or all of the tests in the class.

I propose to make MoreUnit aware of such a situation, and behave as follows:

If trying to run in an abstract class, MoreUnit should check for concrete subclasses of the abstract class and distinguish these situations:

  • there's only one concrete subclass: then the test should be run as a test of this subclass
  • there are several concrete subclasses:
    • show a popup and let the user choose which concree class to use,
    • the popup should contain an option "all concrete subclasses" that executes the method in all subclasses (ideally as last option, so a press of the "end" key directly moves the selection to this option),
    • the last run subclass should be on top, so a single press of "enter" would invoke this option, making it easy to repeatedly run the same test.

The same logic should be applied when trying to invoke a test from the CUT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant