-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Diffblue-benchmarks/add-unit-tests-for-org…
….rapidpm.frp.model Add unit tests for org.rapidpm.frp.model
- Loading branch information
Showing
8 changed files
with
718 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package junit.org.rapidpm.frp.model; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.rapidpm.frp.model.Pair; | ||
|
||
public class PairTest { | ||
|
||
@Test | ||
public void testEquals() { | ||
final Pair pair = new Pair(0, 1); | ||
|
||
assertFalse(pair.equals(null)); | ||
assertFalse(pair.equals(new Pair(null, 1))); | ||
assertFalse(pair.equals(new Pair(0, null))); | ||
assertTrue(pair.equals(pair)); | ||
assertTrue(pair.equals(new Pair(0, 1))); | ||
} | ||
|
||
@Test | ||
public void testHashCode() { | ||
final Pair pair = new Pair(0, 1); | ||
|
||
assertEquals(962, pair.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testNext() { | ||
final Pair pair = Pair.next(0, 1); | ||
|
||
assertNotNull(pair); | ||
assertEquals(0, pair.getT1()); | ||
assertEquals(1, pair.getT2()); | ||
} | ||
|
||
@Test | ||
public void testToString() { | ||
final Pair pair = new Pair(0, 1); | ||
|
||
assertEquals("Pair{t1=0, t2=1}", pair.toString()); | ||
} | ||
} |
109 changes: 109 additions & 0 deletions
109
src/test/java/junit/org/rapidpm/frp/model/QuadTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
package junit.org.rapidpm.frp.model; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.rapidpm.frp.model.Quad; | ||
|
||
public class QuadTest { | ||
|
||
@Test | ||
public void testEquals() { | ||
final Quad quad = new Quad(0, 1, 2, 3); | ||
|
||
assertTrue(quad.equals(quad)); | ||
assertFalse(quad.equals(null)); | ||
assertFalse(quad.equals(new Quad(null, 1, 2, 3))); | ||
assertFalse(quad.equals(new Quad(0, null, 2, 3))); | ||
assertFalse(quad.equals(new Quad(0, 1, null, 3))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT1() { | ||
final Quad quad = new Quad(null, 1, 2, 3); | ||
|
||
assertTrue(quad.equals(new Quad(null, 1, 2, 3))); | ||
assertFalse(quad.equals(new Quad(0, 1, 2, 3))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT2() { | ||
final Quad quad = new Quad(0, null, 2, 3); | ||
|
||
assertTrue(quad.equals(new Quad(0, null, 2, 3))); | ||
assertFalse(quad.equals(new Quad(0, 1, 2, 3))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT3() { | ||
final Quad quad = new Quad(0, 1, null, 3); | ||
|
||
assertTrue(quad.equals(new Quad(0, 1, null, 3))); | ||
assertFalse(quad.equals(new Quad(0, 1, 2, 3))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT4() { | ||
final Quad quad = new Quad(0, 1, 2, null); | ||
|
||
assertTrue(quad.equals(new Quad(0, 1, 2, null))); | ||
assertFalse(quad.equals(new Quad(0, 1, 2, 3))); | ||
} | ||
|
||
@Test | ||
public void testHashCode() { | ||
final Quad quad = new Quad(0, 1, 2, 3); | ||
|
||
assertEquals(1026, quad.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT1() { | ||
final Quad quad = new Quad(null, 1, 2, 3); | ||
|
||
assertEquals(1026, quad.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT2() { | ||
final Quad quad = new Quad(0, null, 2, 3); | ||
|
||
assertEquals(65, quad.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT3() { | ||
final Quad quad = new Quad(0, 1, null, 3); | ||
|
||
assertEquals(964, quad.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT4() { | ||
final Quad quad = new Quad(0, 1, 2, null); | ||
|
||
assertEquals(1023, quad.hashCode()); | ||
} | ||
|
||
|
||
@Test | ||
public void testNext() { | ||
final Quad quad = Quad.next(0, 1, 2, 3); | ||
|
||
assertNotNull(quad); | ||
assertEquals(0, quad.getT1()); | ||
assertEquals(1, quad.getT2()); | ||
assertEquals(2, quad.getT3()); | ||
assertEquals(3, quad.getT4()); | ||
} | ||
|
||
@Test | ||
public void testToString() { | ||
final Quad quad = new Quad(0, 1, 2, 3); | ||
|
||
assertEquals("Quad{t1=0, t2=1, t3=2, t4=3}", quad.toString()); | ||
} | ||
} |
125 changes: 125 additions & 0 deletions
125
src/test/java/junit/org/rapidpm/frp/model/QuintTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
package junit.org.rapidpm.frp.model; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.rapidpm.frp.model.Quint; | ||
|
||
public class QuintTest { | ||
|
||
@Test | ||
public void testEquals() { | ||
final Quint quint = new Quint(0, 1, 2, 3, 4); | ||
|
||
assertTrue(quint.equals(quint)); | ||
assertFalse(quint.equals(null)); | ||
assertFalse(quint.equals(new Quint(null, 1, 2, 3, 4))); | ||
assertFalse(quint.equals(new Quint(0, null, 2, 3, 4))); | ||
assertFalse(quint.equals(new Quint(0, 1, null, 3, 4))); | ||
assertFalse(quint.equals(new Quint(0, 1, 2, null, 4))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT1() { | ||
final Quint quint = new Quint(null, 1, 2, 3, 4); | ||
|
||
assertTrue(quint.equals(new Quint(null, 1, 2, 3, 4))); | ||
assertFalse(quint.equals(new Quint(0, 1, 2, 3, 4))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT2() { | ||
final Quint quint = new Quint(0, null, 2, 3, 4); | ||
|
||
assertTrue(quint.equals(new Quint(0, null, 2, 3, 4))); | ||
assertFalse(quint.equals(new Quint(0, 1, 2, 3, 4))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT3() { | ||
final Quint quint = new Quint(0, 1, null, 3, 4); | ||
|
||
assertTrue(quint.equals(new Quint(0, 1, null, 3, 4))); | ||
assertFalse(quint.equals(new Quint(0, 1, 2, 3, 4))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT4() { | ||
final Quint quint = new Quint(0, 1, 2, null, 4); | ||
|
||
assertTrue(quint.equals(new Quint(0, 1, 2, null, 4))); | ||
assertFalse(quint.equals(new Quint(0, 1, 2, 3, 4))); | ||
} | ||
|
||
@Test | ||
public void testEqualsT5() { | ||
final Quint quint = new Quint(0, 1, 2, 3, null); | ||
|
||
assertTrue(quint.equals(new Quint(0, 1, 2, 3, null))); | ||
assertFalse(quint.equals(new Quint(0, 1, 2, 3, 4))); | ||
} | ||
|
||
@Test | ||
public void testHashCode() { | ||
final Quint quint = new Quint(0, 1, 2, 3, 4); | ||
|
||
assertEquals(31810, quint.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT1() { | ||
final Quint quint = new Quint(null, 1, 2, 3, 4); | ||
|
||
assertEquals(31810, quint.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT2() { | ||
final Quint quint = new Quint(0, null, 2, 3, 4); | ||
|
||
assertEquals(2019, quint.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT3() { | ||
final Quint quint = new Quint(0, 1, null, 3, 4); | ||
|
||
assertEquals(29888, quint.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT4() { | ||
final Quint quint = new Quint(0, 1, 2, null, 4); | ||
|
||
assertEquals(31717, quint.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testHashCodeT5() throws Exception { | ||
final Quint quint = new Quint(0, 1, 2, 3, null); | ||
|
||
assertEquals(31806, quint.hashCode()); | ||
} | ||
|
||
@Test | ||
public void testNext() { | ||
final Quint quint = Quint.next(0, 1, 2, 3, 4); | ||
|
||
assertNotNull(quint); | ||
assertEquals(0, quint.getT1()); | ||
assertEquals(1, quint.getT2()); | ||
assertEquals(2, quint.getT3()); | ||
assertEquals(3, quint.getT4()); | ||
assertEquals(4, quint.getT5()); | ||
} | ||
|
||
@Test | ||
public void testToString() { | ||
final Quint quint = new Quint(0, 1, 2, 3, 4); | ||
|
||
assertEquals("Quint{t1=0, t2=1, t3=2, t4=3, t5=4}", quint.toString()); | ||
} | ||
} |
Oops, something went wrong.