hprange / wounit

The WOUnit framework contains a set of utilities for testing WebObjects applications using JUnit 4.7 or later capabilities.
http://hprange.github.io/wounit/
Apache License 2.0
19 stars 18 forks source link

@UnderTest annotation to create the EO being tested #10

Closed hprange closed 13 years ago

hprange commented 13 years ago

When testing an EO, usually a basic setup have to be made in order to test an EO:

private EO eo;

@Before pubic void setup() { eo = EO.createEO(ec); }

The @UnderTest annotation could be used to reduce the amount of boilerplate code.

@UnderTest private EO eo;

The MockEditingContext and the TemporaryEditingContext rules creates and inserts the EO automagically.

The annotation is also useful as a sanity check. Unit tests usually will have only one field annotated with @UnderTest.