Package games.gofish.state

Examples of games.gofish.state.ComputerTurnSate


  /**
   * Test to make sure the state can be changed
   */
  public void testChangingState()
  {
    goFish.setState(new ComputerTurnSate());
    assertTrue(goFish.getState() instanceof ComputerTurnSate);
    goFish.setState(new PlayerTurnState());
    assertTrue(goFish.getState() instanceof PlayerTurnState);
  }
View Full Code Here


   */
  public void testGoFish()
  {
    goFish.goFish();
    assertEquals(8, goFish.getPlayer().getHand().getSize());
    goFish.setState(new ComputerTurnSate());
    goFish.goFish();
    assertEquals(8, goFish.getComputer().getHand().getSize());
  }
View Full Code Here

    //Test player
    goFish.getPlayer().getHand().addCards(list);
    assertTrue(goFish.checkForMatch());
   
    //Test computer
    goFish.setState(new ComputerTurnSate());
    goFish.getComputer().getHand().addCards(list);
    assertTrue(goFish.checkForMatch());
   
    //Remove all cards and make sure no matches are found
    for (int i = 0; i < goFish.getPlayer().getHand().getSize();)
    {
      goFish.getPlayer().getHand().removeCard(i);
      goFish.getComputer().getHand().removeCard(i);
    }
   
    //Test player
    goFish.setState(new PlayerTurnState());
    assertFalse(goFish.checkForMatch());
   
    //Test computer
    goFish.setState(new ComputerTurnSate());
    assertFalse(goFish.checkForMatch());
  }
View Full Code Here

TOP

Related Classes of games.gofish.state.ComputerTurnSate

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.