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

Create collection of dummy objects #21

Closed hprange closed 12 years ago

hprange commented 12 years ago

Some tests require more than one object of a type to verify the expected condition.

private NSArray foos;

@Before public void setup() { foos = new NSMutableArray();

foos.add(ec.createSavedObject(Foo.class));
foos.add(ec.createSavedObject(Foo.class));

}

We could enhance the @Dummy annotation to support this kind of feature out of the box.

@Dummy(size=2) private NSArray foos;

We can support NSArray, NSSet among other kinds of Collection.

The default value for the size parameter should be one.