EMMA Coverage Report (generated Tue Jan 30 22:35:40 CST 2007)
[all classes][com.ociweb.emma.ex1]

COVERAGE SUMMARY FOR SOURCE FILE [PokerHandTestCase.java]

nameclass, %method, %block, %line, %
PokerHandTestCase.java100% (1/1)100% (4/4)100% (73/73)100% (16/16)

COVERAGE BREAKDOWN BY CLASS AND METHOD

nameclass, %method, %block, %line, %
     
class PokerHandTestCase100% (1/1)100% (4/4)100% (73/73)100% (16/16)
PokerHandTestCase (): void 100% (1/1)100% (12/12)100% (4/4)
buildHand (int, int, int, int, int, int): PokerHand 100% (1/1)100% (37/37)100% (6/6)
setUp (): void 100% (1/1)100% (6/6)100% (2/2)
testIsPair_Pair (): void 100% (1/1)100% (18/18)100% (4/4)

1package com.ociweb.emma.ex1;
2 
3import java.util.ArrayList;
4import java.util.List;
5 
6import junit.framework.TestCase;
7 
8public class PokerHandTestCase extends TestCase {
9 
10        PokerHand pokerHand = null;
11        List cards = null;
12        PokerHand.Hand result = null;
13        
14        public void setUp() {
15                cards = new ArrayList();
16        }
17        
18        private PokerHand buildHand( int card1, int suit1, int card2, int suit2, int card3, int suit3) {
19                PokerHand pokerHand = null;
20                
21                cards.add( new Card(card1, suit1) );
22                cards.add( new Card(card2, suit2) );
23                cards.add( new Card(card3, suit3) );
24                
25                pokerHand = new PokerHand(cards);
26                
27                return pokerHand;
28        }
29 
30 
31        // test pair  
32 
33        public void testIsPair_Pair() {
34                pokerHand = buildHand( Card.TWO, Card.CLUBS, Card.TWO, Card.HEARTS, Card.NINE, Card.SPADES );
35                PokerHand.Hand result = pokerHand.evaluate();
36                assertEquals( PokerHand.Hand.PAIR, result );                
37        }
38 
39//        public void testIsPair_UnsortedPair() {
40//                pokerHand = buildHand( Card.TWO, Card.CLUBS, Card.THREE, Card.HEARTS, Card.TWO, Card.SPADES );
41//                PokerHand.Hand result = pokerHand.evaluate();
42//                assertEquals( PokerHand.Hand.PAIR, result );                
43//        }
44//        
45//        public void testIsPair_ThreeOfKind() {
46//                pokerHand = buildHand( Card.TWO, Card.CLUBS, Card.TWO, Card.HEARTS, Card.TWO, Card.SPADES );
47//                PokerHand.Hand result = pokerHand.evaluate();
48//                assertFalse( PokerHand.Hand.PAIR == result );                
49//        }
50        
51}

[all classes][com.ociweb.emma.ex1]
EMMA 2.0.5312 (C) Vladimir Roubtsov