massiveinteractive/MassiveUnit — Issue #17: AbstractTest - Testing interfaces and abstract superclasses
Author: Dr-Emann
Created: 2012-03-10 07:41:46+00:00
State: open

Description
-----------------
It is possible to write tests for an interface, which must be passed by all implementations of the interface. However, munit currently tries to add these abstract tests by themselves, when they should only be run by subclasses of the tests, which work with concrete implementations.

### Code to replicate issue ###
```haXe
interface IAbstract {
function returnTrue():Bool;
}
class Concrete implements IAbstract {
public function returnTrue():Bool {
return false;
}
}
```
```haXe
class IAbstractTest {
public var instance:IAbstract;
@Test
public function testReturnTrue():Void {
Assert.isTrue(instance.returnTrue());
}
}
```
Current Workarounds
------------------------------
* Add a separate source folder that is not managed by munit, so it will not add the tests, but they can still be seen and subclassed
* Handle TestSuite manually, because munit will automatically add all classes in the test src directory.

Proposed Solution
-----------------
Add a bit of metadata that allows a class to be overlooked when checking for test classes. I suggest ```@AbstractTest```.

### Example ###

```haXe
@AbstractTest
class IAbstractTest
{
public var instance:IAbstract;
@Test
public function testReturnTrue():Void {
Assert.isTrue(instance.returnTrue());
}
}
```