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