package au.id.zancanaro.javacheck.object; import au.id.zancanaro.javacheck.Generator; import au.id.zancanaro.javacheck.annotations.DataSource; import au.id.zancanaro.javacheck.annotations.Property; import au.id.zancanaro.javacheck.junit.Properties; import org.junit.runner.RunWith; import java.util.Collections; import static au.id.zancanaro.javacheck.Generators.ofType; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; @RunWith(Properties.class) public class MyObjectAddTest { @DataSource public static Generator source = ofType(MyObject.class); @Property public void testAdd(MyObject a, MyObject b) { MyObject added = a.add(b); assertTrue(added.string.length() == a.string.length() + b.string.length()); assertTrue(added.value == a.value + b.value); assertEquals(added.subObject, a.subObject.add(b.subObject)); } }