Permalink
Browse files

Added pholser's example from JUnit mailing list

  • Loading branch information...
1 parent 4b238e0 commit d021dd2edf6d979df15eac1b8a25a4011d56c673 @marcphilipp committed Oct 20, 2010
Showing with 21 additions and 0 deletions.
  1. +21 −0 src/main/java/de/xpdays/junit/MathTheories.java
@@ -0,0 +1,21 @@
+package de.xpdays.junit;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assume.assumeTrue;
+
+import org.junit.experimental.theories.Theories;
+import org.junit.experimental.theories.Theory;
+import org.junit.runner.RunWith;
+
+import com.pholser.junit.parameters.ForAll;
+
+@RunWith(Theories.class)
+public class MathTheories {
+
+ @Theory
+ public void absoluteValueOfNegatives(@ForAll int n) {
+ System.out.println(n);
+ assumeTrue(n < 0);
+ assertEquals(-n, Math.abs(n));
+ }
+}

0 comments on commit d021dd2

Please sign in to comment.