Skip to content

Commit

Permalink
Adds additional recursion tests for withPrefabValuesForField
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed Dec 4, 2024
1 parent cb0f83e commit b9dcec8
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,21 @@ public void succeed_whenDatastructureIsRecursive_givenPrefabValues() {
EqualsVerifier.forClass(Node.class).withPrefabValues(Node.class, red, blue).verify();
}

@Test
public void succeed_whenDatastructureIsRecursive_givenPrefabValuesForField() {
EqualsVerifier.forClass(Node.class).withPrefabValuesForField("node", red, blue).verify();
}

@Test
public void succeed_whenDatastructureIsRecursive_givenPrefabValuesOfSuperclass() {
EqualsVerifier.forClass(SubNode.class).withPrefabValues(Node.class, red, blue).verify();
}

@Test
public void succeed_whenDatastructureIsRecursive_givenPrefabValuesForFieldOfSuperclass() {
EqualsVerifier.forClass(SubNode.class).withPrefabValuesForField("node", red, blue).verify();
}

@Test
public void fail_whenFieldIsARecursiveType() {
ExpectedException
Expand All @@ -66,6 +76,14 @@ public void succeed_whenFieldIsARecursiveType_givenPrefabValues() {
.verify();
}

@Test
public void succeed_whenFieldIsARecursiveType_givenPrefabValuesForField() {
EqualsVerifier
.forClass(NodeContainer.class)
.withPrefabValuesForField("node", red, blue)
.verify();
}

@Test
public void succeed_whenFieldIsARecursiveType_givenPrefabValuesOfSuperclass() {
EqualsVerifier
Expand All @@ -74,6 +92,14 @@ public void succeed_whenFieldIsARecursiveType_givenPrefabValuesOfSuperclass() {
.verify();
}

@Test
public void succeed_whenFieldIsARecursiveType_givenPrefabValuesForFieldOfSuperclass() {
EqualsVerifier
.forClass(SubNodeContainer.class)
.withPrefabValuesForField("node", red, blue)
.verify();
}

@Test
public void fail_whenDatastructureIsRecursiveInGenerics() {
ExpectedException
Expand Down

0 comments on commit b9dcec8

Please sign in to comment.