diff options
Diffstat (limited to 'src/test/java')
-rw-r--r-- | src/test/java/au/id/zancanaro/javacheck/junit/SimpleListOperationsTest.java (renamed from src/test/java/au/id/zancanaro/SimpleListOperationsTest.java) | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/test/java/au/id/zancanaro/SimpleListOperationsTest.java b/src/test/java/au/id/zancanaro/javacheck/junit/SimpleListOperationsTest.java index 20f419a..8a298be 100644 --- a/src/test/java/au/id/zancanaro/SimpleListOperationsTest.java +++ b/src/test/java/au/id/zancanaro/javacheck/junit/SimpleListOperationsTest.java @@ -1,15 +1,16 @@ -package au.id.zancanaro; +package au.id.zancanaro.javacheck.junit; -import au.id.zancanaro.annotations.DataSource; -import au.id.zancanaro.annotations.Property; +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.ArrayList; import java.util.Collections; import java.util.List; -import static au.id.zancanaro.Generators.integer; -import static au.id.zancanaro.Generators.listOf; +import static au.id.zancanaro.javacheck.Generators.*; import static org.junit.Assert.assertEquals; @RunWith(Properties.class) @@ -18,7 +19,10 @@ public class SimpleListOperationsTest { @DataSource public static Generator<List<Integer>> listOfIntegers = listOf(integer()); - @Property + @DataSource + public static Generator<List<String>> listOfStrings = listOf(stringOf(alphaNumericCharacter())); + + @Property(maxSize = 100, runs = 1000) public void sortingIsIdempotent(List<Integer> list) { List<Integer> left = new ArrayList<>(list); Collections.sort(left); @@ -30,9 +34,9 @@ public class SimpleListOperationsTest { assertEquals(left, right); } - @Property(maxSize = 10000, runs = 10000) - public void reverseIsItsOwnInverse(List<Integer> list) { - List<Integer> reversed = new ArrayList<>(list); + @Property(maxSize = 100, runs = 1000) + public void reverseIsItsOwnInverse(List<String> list) { + List<String> reversed = new ArrayList<>(list); Collections.reverse(reversed); Collections.reverse(reversed); |