summaryrefslogtreecommitdiff
path: root/src/test/java/au
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/au')
-rw-r--r--src/test/java/au/id/zancanaro/PropertyTests.java17
-rw-r--r--src/test/java/au/id/zancanaro/TheoriesTest.java22
2 files changed, 34 insertions, 5 deletions
diff --git a/src/test/java/au/id/zancanaro/PropertyTests.java b/src/test/java/au/id/zancanaro/PropertyTests.java
index 3620e67..374a974 100644
--- a/src/test/java/au/id/zancanaro/PropertyTests.java
+++ b/src/test/java/au/id/zancanaro/PropertyTests.java
@@ -1,13 +1,20 @@
package au.id.zancanaro;
import au.id.zancanaro.annotations.Property;
-import org.junit.Assert;
-import org.junit.Assume;
+import org.junit.*;
import org.junit.experimental.theories.DataPoint;
import org.junit.runner.RunWith;
@RunWith(PropertyTestRunner.class)
public class PropertyTests {
+ public static Generator<Integer> gen = Generators.integer();
+
+ @Test
+ public void testblah() throws Exception {
+ Assert.assertEquals(10, 11);
+
+ }
+
@Property
public void aIsNotOdd(int a, int b) {
Assume.assumeFalse(a % 2 == 1);
@@ -21,8 +28,8 @@ public class PropertyTests {
}
@Property
- public void aIsNotGreaterThanB(int a, int b) {
-// Assume.assumeFalse(a > b);
- Assert.assertFalse(a > b);
+ public void aPlusBLessThanOneHundred(int a, int b) {
+ Assert.assertTrue("a plus b is five", a + b == 5);
+ Assert.assertEquals(a + b, 5);
}
}
diff --git a/src/test/java/au/id/zancanaro/TheoriesTest.java b/src/test/java/au/id/zancanaro/TheoriesTest.java
new file mode 100644
index 0000000..7d5071c
--- /dev/null
+++ b/src/test/java/au/id/zancanaro/TheoriesTest.java
@@ -0,0 +1,22 @@
+package au.id.zancanaro;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.junit.experimental.theories.DataPoint;
+import org.junit.experimental.theories.Theories;
+import org.junit.experimental.theories.Theory;
+import org.junit.runner.RunWith;
+
+@RunWith(Theories.class)
+public class TheoriesTest {
+ @DataPoint
+ public static String car = "carlo";
+
+ @DataPoint
+ public static String car2 = "carlo2";
+
+ @Theory
+ public void testName(String str) throws Exception {
+ Assert.assertEquals(str, car2);
+ }
+}