Skip to content

Commit

Permalink
Merge pull request #6 from Diffblue-benchmarks/add-unit-tests-for-org…
Browse files Browse the repository at this point in the history
….rapidpm.frp.model

Add unit tests for org.rapidpm.frp.model
  • Loading branch information
svenruppert authored May 13, 2019
2 parents 5479c6e + 9ec8f0a commit 832d8c3
Show file tree
Hide file tree
Showing 8 changed files with 718 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main/java/org/rapidpm/frp/model/Sext.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,13 @@ public int hashCode() {
/** {@inheritDoc} */
@Override
public String toString() {
return "Quint{" +
return "Sext{" +
"t1=" + t1 +
", t2=" + t2 +
", t3=" + t3 +
", t4=" + t4 +
", t5=" + t5 +
", t6=" + t6 +
'}';
}

Expand Down
46 changes: 46 additions & 0 deletions src/test/java/junit/org/rapidpm/frp/model/PairTest.java
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 src/test/java/junit/org/rapidpm/frp/model/QuadTest.java
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 src/test/java/junit/org/rapidpm/frp/model/QuintTest.java
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());
}
}
Loading

0 comments on commit 832d8c3

Please sign in to comment.