Package Project1.Game

Examples of Project1.Game.Card


    {
        PlayerController pc = new PlayerController(new Cheating(), new Cheating());
        String properOutPlayer1 = "0-c";
        String properOutPlayer2 = "0-c \t\t1-c\n";

        pc.placeCard(0, new Card(0, 'c'));
        assertEquals(properOutPlayer1, outContent.toString());

        pc.placeCard(1, new Card(1, 'c'));
        assertEquals(properOutPlayer2, outContent.toString());
    }
View Full Code Here


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

        pc.player1Card = new Card(10, 'c');
        pc.player2Card = new Card(1, 'c');

        assertEquals(0, pc.findWinner());

        pc.player1Card = new Card(1, 'c');
        pc.player2Card = new Card(10, 'c');

        assertEquals(1, pc.findWinner());
    }
View Full Code Here

    @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

{
    // constructors -----------------------------------------------------------

    public Project2()
    {
        Project1 project = new Project1();
    }
View Full Code Here

{
    // constructors -----------------------------------------------------------

    public Project2()
    {
        Project1 project = new Project1();
    }
View Full Code Here

    // constructors -----------------------------------------------------------

    public Project2()
    {
        Project1 project = new Project1();
    }
View Full Code Here

TOP

Related Classes of Project1.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.