Clover Coverage Report - EasyMock 2.4
Coverage timestamp: mer. juil. 2 2008 02:17:38 CEST
18   54   3   6
0   37   0,17   3
3     1  
1    
 
 
  UsageFloatingPointReturnValueTest       Line # 14 18 3 100% 1.0
 
  (2)
 
1    /*
2    * Copyright (c) 2001-2008 OFFIS, Tammo Freese.
3    * This program is made available under the terms of the MIT License.
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")
 
14    public class UsageFloatingPointReturnValueTest {
15    MockControl<IMethods> control;
16   
17    IMethods mock;
18   
 
19  2 toggle @Before
20    public void setup() {
21  2 control = MockControl.createControl(IMethods.class);
22  2 mock = control.getMock();
23    }
24   
 
25  1 toggle @Test
26    public void returnFloat() {
27  1 mock.floatReturningMethod(0);
28  1 control.setReturnValue(25.0F);
29  1 control.setDefaultReturnValue(34.0F);
30   
31  1 control.replay();
32   
33  1 assertEquals(25.0F, mock.floatReturningMethod(0), 0.0F);
34  1 assertEquals(34.0F, mock.floatReturningMethod(-4), 0.0F);
35  1 assertEquals(34.0F, mock.floatReturningMethod(12), 0.0F);
36   
37  1 control.verify();
38    }
39   
 
40  1 toggle @Test
41    public void returnDouble() {
42  1 mock.doubleReturningMethod(0);
43  1 control.setReturnValue(25.0);
44  1 control.setDefaultReturnValue(34.0);
45   
46  1 control.replay();
47   
48  1 assertEquals(25.0, mock.doubleReturningMethod(0), 0.0);
49  1 assertEquals(34.0, mock.doubleReturningMethod(-4), 0.0);
50  1 assertEquals(34.0, mock.doubleReturningMethod(12), 0.0);
51   
52  1 control.verify();
53    }
54    }