Package games.memory.state

Source Code of games.memory.state.TestEndGameState

package games.memory.state;

import static org.junit.Assert.*;
import games.memory.Memory;

import org.junit.Test;

/**
* Tests associated with EndGameState
* @author Ian Keefer
*/
public class TestEndGameState
{

 
  /**
   * tests the initlization of end game state
   */
  @Test
  public void testInitlization()
  {
    Memory.reset();
    Memory m = Memory.getInstance();
    MemoryState state = new EndGameState(m);
    m.setState(state);
    assertEquals(state, m.getState());
  }
 
 
  /**
   * tests handling the state and switching states
   */
  @Test
  public void testEndGame()
  {
    Memory.reset();
    Memory m = Memory.getInstance();
    MemoryState state = new EndGameState(m);
    m.setState(state);
    state.handle();
    assertTrue(m.getState() instanceof PlayingState);
  }
 
}
TOP

Related Classes of games.memory.state.TestEndGameState

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.