@@ -54,15 +54,28 @@ public void differentParameterizedAssertionErrorsHaveDifferentToStrings(
54
54
@ Theory
55
55
public void equalsReturnsTrue (Throwable targetException , String methodName ,
56
56
Object [] params ) {
57
- assertThat (new ParameterizedAssertionError (targetException , methodName ,
58
- params ), is (new ParameterizedAssertionError (targetException ,
59
- methodName , params )));
57
+ assertThat (
58
+ new ParameterizedAssertionError (targetException , methodName , params ),
59
+ is (new ParameterizedAssertionError (targetException , methodName , params )));
60
+ }
61
+
62
+ @ Theory
63
+ public void sameHashCodeWhenEquals (Throwable targetException , String methodName ,
64
+ Object [] params ) {
65
+ ParameterizedAssertionError one = new ParameterizedAssertionError (
66
+ targetException , methodName , params );
67
+ ParameterizedAssertionError two = new ParameterizedAssertionError (
68
+ targetException , methodName , params );
69
+ assumeThat (one , is (two ));
70
+
71
+ assertThat (one .hashCode (), is (two .hashCode ()));
60
72
}
61
73
62
74
@ Theory (nullsAccepted = false )
63
75
public void buildParameterizedAssertionError (String methodName , String param ) {
64
- assertThat (new ParameterizedAssertionError (new RuntimeException (),
65
- methodName , param ).toString (), containsString (methodName ));
76
+ assertThat (new ParameterizedAssertionError (
77
+ new RuntimeException (), methodName , param ).toString (),
78
+ containsString (methodName ));
66
79
}
67
80
68
81
@ Theory
0 commit comments