Skip to content

Commit

Permalink
Improves names for test classes
Browse files Browse the repository at this point in the history
  • Loading branch information
jqno committed May 10, 2021
1 parent 803a47f commit 034a294
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class SimpleEqualsVerifierTest {

@Test
public void succeed_whenTestingGeneratedClass_givenASimpleEqualsVerifier() {
EqualsVerifier.simple().forClass(IntelliJPoint.class).verify();
EqualsVerifier.simple().forClass(SimplePoint.class).verify();
}

@Test
Expand All @@ -25,7 +25,7 @@ public void succeed_whenTestingGeneratedClassesRecursively_givenASimpleEqualsVer
@Test
public void mentionSimple_whenTestingGeneratedClass_givenNothingSpecial() {
ExpectedException
.when(() -> EqualsVerifier.forClass(IntelliJPoint.class).verify())
.when(() -> EqualsVerifier.forClass(SimplePoint.class).verify())
.assertFailure()
.assertMessageContains("or use EqualsVerifier.simple()");
}
Expand All @@ -52,21 +52,21 @@ public void mentionSimple_whenTestingGeneratedClass_givenSuppressWarningStrictIn
.when(
() ->
EqualsVerifier
.forClass(IntelliJPoint.class)
.forClass(SimplePoint.class)
.suppress(Warning.STRICT_INHERITANCE)
.verify()
)
.assertFailure()
.assertMessageContains("or use EqualsVerifier.simple()");
}

public static class IntelliJPoint {
public static class SimplePoint {

private int x;
private int y;
private Color color;

public IntelliJPoint(int x) {
public SimplePoint(int x) {
this.x = x;
}

Expand All @@ -78,7 +78,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
IntelliJPoint that = (IntelliJPoint) o;
SimplePoint that = (SimplePoint) o;
return x == that.x && y == that.y && color == that.color;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import java.util.Objects;
import nl.jqno.equalsverifier.testhelpers.types.Color;

public class IntelliJPoint1 {
public class SimplePoint {

private int x;
private int y;
private Color color;

public IntelliJPoint1(int x) {
public SimplePoint(int x) {
this.x = x;
}

Expand All @@ -21,7 +21,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
IntelliJPoint1 that = (IntelliJPoint1) o;
SimplePoint that = (SimplePoint) o;
return x == that.x && y == that.y && color == that.color;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import java.util.Objects;
import nl.jqno.equalsverifier.testhelpers.types.Color;

public class IntelliJPoint2 {
public class SimplePoint {

private int x;
private int y;
private Color color;

public IntelliJPoint2(int x) {
public SimplePoint(int x) {
this.x = x;
}

Expand All @@ -21,7 +21,7 @@ public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) {
return false;
}
IntelliJPoint2 that = (IntelliJPoint2) o;
SimplePoint that = (SimplePoint) o;
return x == that.x && y == that.y && color == that.color;
}

Expand Down

0 comments on commit 034a294

Please sign in to comment.