Skip to content

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

@dstango

Description

@dstango

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions