summaryrefslogtreecommitdiff
path: root/src/test/java/au/id/zancanaro/javacheck/object/MyObjectAddTest.java
blob: 9321acb9811885a0b1b5e1448eece8632323e753 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package au.id.zancanaro.javacheck.object;

import au.id.zancanaro.javacheck.annotations.Property;
import au.id.zancanaro.javacheck.junit.Properties;
import org.junit.runner.RunWith;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

@RunWith(Properties.class)
public class MyObjectAddTest {

    @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));
    }

}