Package game

Examples of game.Card


    @Test
    public void testCheckForWar()
    {
        PlayerController pc = new PlayerController(new Cheating(), new Cheating());

        assertTrue(pc.checkForWar(new Card(10, 'c'), new Card(10, 'd')));
        assertFalse(pc.checkForWar(new Card(10, 'c'), new Card(9, 'd')));
    }
View Full Code Here


    @Test
    public void testCheckForWarNullCards()
    {
        PlayerController pc = new PlayerController(new Cheating(), new Cheating());

        assertFalse(pc.checkForWar(null, new Card(10, 'd')));
        assertFalse(pc.checkForWar(new Card(10, 'c'), null));
        assertFalse(pc.checkForWar(null, null));
    }
View Full Code Here

    public void testWar()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        Card array[] = player.war();
       
        assertTrue(array[0] != null);
        assertTrue(array[1] != null);
        assertTrue(array[2] != null);
    }
View Full Code Here

        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        ArrayList<Card> cards = new ArrayList<Card>();
       
        Card c1 = new Card(6, 'c');
        Card c2 = new Card(5, 'c');
        Card c3 = new Card(10, 'c');
        cards.add(c1);
        cards.add(c2);
        cards.add(c3);

        player.clearHand();
        player.addCardsToHand(cards);
        Card array[] = player.war();
       
        assertEquals(c1, array[0]);
        assertEquals(c2, array[1]);
        assertEquals(null, array[2]);
       
View Full Code Here

        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        ArrayList<Card> cards = new ArrayList<Card>();
       
        Card c1 = new Card(6, 'c');
        Card c2 = new Card(5, 'c');
        Card c3 = new Card(10, 'c');
        cards.add(c1);
        cards.add(c2);
        cards.add(c3);

        player.clearHand();
View Full Code Here

TOP

Related Classes of game.Card

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.