| 1 |
|
|
| 2 |
|
|
| 3 |
|
|
| 4 |
|
|
| 5 |
|
package org.easymock.tests2; |
| 6 |
|
|
| 7 |
|
import static org.easymock.EasyMock.*; |
| 8 |
|
import static org.junit.Assert.*; |
| 9 |
|
|
| 10 |
|
import org.easymock.tests.IMethods; |
| 11 |
|
import org.junit.Before; |
| 12 |
|
import org.junit.Test; |
| 13 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (15) |
Complexity: 5 |
Complexity Density: 0,5 |
|
| 14 |
|
public class NiceMockTest { |
| 15 |
|
|
| 16 |
|
IMethods mock; |
| 17 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
|
| 18 |
4
|
@Before... |
| 19 |
|
public void setup() { |
| 20 |
4
|
mock = createNiceMock(IMethods.class); |
| 21 |
4
|
replay(mock); |
| 22 |
|
} |
| 23 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
1
PASS
|
|
| 24 |
1
|
@Test... |
| 25 |
|
public void defaultReturnValueBoolean() { |
| 26 |
1
|
assertEquals(false, mock.booleanReturningMethod(12)); |
| 27 |
1
|
verify(mock); |
| 28 |
|
} |
| 29 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
1
PASS
|
|
| 30 |
1
|
@Test... |
| 31 |
|
public void defaultReturnValueFloat() { |
| 32 |
1
|
assertEquals(0.0f, mock.floatReturningMethod(12), 0.0f); |
| 33 |
1
|
verify(mock); |
| 34 |
|
} |
| 35 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
1
PASS
|
|
| 36 |
1
|
@Test... |
| 37 |
|
public void defaultReturnValueDouble() { |
| 38 |
1
|
assertEquals(0.0d, mock.doubleReturningMethod(12), 0.0d); |
| 39 |
1
|
verify(mock); |
| 40 |
|
} |
| 41 |
|
|
|
|
|
| 100% |
Uncovered Elements: 0 (2) |
Complexity: 1 |
Complexity Density: 0,5 |
1
PASS
|
|
| 42 |
1
|
@Test... |
| 43 |
|
public void defaultReturnValueObject() { |
| 44 |
1
|
assertEquals(null, mock.objectReturningMethod(12)); |
| 45 |
1
|
verify(mock); |
| 46 |
|
} |
| 47 |
|
} |