Clover Coverage Report - EasyMock 3.0
Coverage timestamp: sam. mai 8 2010 14:37:27 CEST
10   62   5   2
0   34   0,5   5
5     1  
1    
 
  NiceMockTest       Line # 29 10 0% 5 0 100% 1.0
 
  (8)
 
1    /**
2    * Copyright 2001-2010 the original author or authors.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.apache.org/licenses/LICENSE-2.0
9    *
10    * Unless required by applicable law or agreed to in writing, software
11    * distributed under the License is distributed on an "AS IS" BASIS,
12    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13    * See the License for the specific language governing permissions and
14    * limitations under the License.
15    */
16   
17    package org.easymock.tests2;
18   
19    import static org.easymock.EasyMock.*;
20    import static org.junit.Assert.*;
21   
22    import org.easymock.tests.IMethods;
23    import org.junit.Before;
24    import org.junit.Test;
25   
26    /**
27    * @author OFFIS, Tammo Freese
28    */
 
29    public class NiceMockTest {
30   
31    IMethods mock;
32   
 
33  8 toggle @Before
34    public void setup() {
35  8 mock = createNiceMock(IMethods.class);
36  8 replay(mock);
37    }
38   
 
39  2 toggle @Test
40    public void defaultReturnValueBoolean() {
41  2 assertEquals(false, mock.booleanReturningMethod(12));
42  2 verify(mock);
43    }
44   
 
45  2 toggle @Test
46    public void defaultReturnValueFloat() {
47  2 assertEquals(0.0f, mock.floatReturningMethod(12), 0.0f);
48  2 verify(mock);
49    }
50   
 
51  2 toggle @Test
52    public void defaultReturnValueDouble() {
53  2 assertEquals(0.0d, mock.doubleReturningMethod(12), 0.0d);
54  2 verify(mock);
55    }
56   
 
57  2 toggle @Test
58    public void defaultReturnValueObject() {
59  2 assertEquals(null, mock.objectReturningMethod(12));
60  2 verify(mock);
61    }
62    }