1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
|
17 |
|
package org.easymock.tests; |
18 |
|
|
19 |
|
import static org.junit.Assert.*; |
20 |
|
|
21 |
|
import java.lang.reflect.Method; |
22 |
|
|
23 |
|
import org.easymock.internal.ExpectedInvocation; |
24 |
|
import org.easymock.internal.Invocation; |
25 |
|
import org.junit.Before; |
26 |
|
import org.junit.Test; |
27 |
|
|
28 |
|
|
29 |
|
@author |
30 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (10) |
Complexity: 2 |
Complexity Density: 0,25 |
|
31 |
|
public class MatchableArgumentsTest { |
32 |
|
|
33 |
|
private Object[] arguments; |
34 |
|
|
35 |
|
private Object[] arguments2; |
36 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
37 |
2
|
@Before... |
38 |
|
public void setup() { |
39 |
2
|
arguments = new Object[] { "" }; |
40 |
2
|
arguments2 = new Object[] { "", "" }; |
41 |
|
} |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (6) |
Complexity: 1 |
Complexity Density: 0,17 |
1
PASS
|
|
43 |
2
|
@Test... |
44 |
|
public void testEquals() throws SecurityException, NoSuchMethodException { |
45 |
2
|
final Method toPreventNullPointerExceptionm = Object.class.getMethod("toString", new Class[] {}); |
46 |
|
|
47 |
2
|
final Object mock = new Object(); |
48 |
|
|
49 |
2
|
final ExpectedInvocation matchableArguments = new ExpectedInvocation(new Invocation(mock, |
50 |
|
toPreventNullPointerExceptionm, arguments), null); |
51 |
2
|
final ExpectedInvocation nonEqualMatchableArguments = new ExpectedInvocation(new Invocation(mock, |
52 |
|
toPreventNullPointerExceptionm, arguments2), null); |
53 |
|
|
54 |
2
|
assertFalse(matchableArguments.equals(null)); |
55 |
2
|
assertFalse(matchableArguments.equals(nonEqualMatchableArguments)); |
56 |
|
} |
57 |
|
} |