Package games.war.behaviors

Examples of games.war.behaviors.CheatingBehavior


        Deck dk = Deck.getInstance();
        dk.reset();
        dk.shuffle();
        timer = WarTimer.getInstance();

        CheatingBehavior player1 = new NotCheating();
        CheatingBehavior player2 = new Cheating();
        playerCon = new PlayerController(player1, player2);
        timer.addObserver(playerCon);
    }
View Full Code Here


     * Most functionality is handled by the Player class
     */
    @Test
    public void testInit()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
       
        assertEquals(cheat, player.howToCheat);
    }
View Full Code Here

     * does not return null
     */
    @Test
    public void testCheat()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        assertTrue(player.cheat() != null);
    }
View Full Code Here

     * method is not null
     */
    @Test
    public void testTakeTurn()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        assertTrue(player.takeTurn() != null);
    }
View Full Code Here

     * method are not null.
     */
    @Test
    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);
View Full Code Here

     * Makes sure the war method works with a small hand
     */
    @Test
    public void testWarSmallHand()
    {
        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');
View Full Code Here

     * Makes sure cards can be added to the hand
     */
    @Test
    public void testAddCardsToHand()
    {
        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');
View Full Code Here

     * Makes sure hands can be cleared
     */
    @Test
    public void testClearHand()
    {
        CheatingBehavior cheat = new NotCheating();
        HandBehaviour hand = new WarHand();
        WarPlayer player = new WarPlayer(hand, cheat);
        assertEquals(26, player.getHandSize());
        player.clearHand();
        assertEquals(0, player.getHandSize());
View Full Code Here

TOP

Related Classes of games.war.behaviors.CheatingBehavior

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.