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