Package games.war.behaviors

Source Code of games.war.behaviors.TestNotCheating

package games.war.behaviors;

import static org.junit.Assert.*;
import game.Card;
import games.war.PlayerController;
import hand.Hand;

import java.util.ArrayList;

import org.junit.Test;

/**
* Makes sure the NotCheating behavior works as it should
* @author Chris Hersh
*
*/
public class TestNotCheating
{

    /**
     * Makes sure the correct card is chosen
     */
    @Test
    public void testNotCheating()
    {
        NotCheating cheat = new NotCheating();
        Hand hand = new Hand(10);
        //System.out.println(hand);
        ArrayList<Card> cards = new ArrayList<Card>();
        cards.add(new Card(6, 'c'));
        cards.add(new Card(5, 'c'));
        cards.add(new Card(10, 'c'));
        cards.add(new Card(8, 'c'));
        cards.add(new Card(1, 'c'));
        cards.add(new Card(3, 'c'));
        cards.add(new Card(2, 'c'));
        hand.addCards(cards);
       
        assertEquals(cheat.getNextCard(hand), cards.get(0));
    }

}
TOP

Related Classes of games.war.behaviors.TestNotCheating

TOP
Copyright © 2018 www.massapi.com. 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.