package games.memory.state;
import static org.junit.Assert.*;
import games.memory.Memory;
import org.junit.Test;
/**
* Tests associated with PlayingState
* @author Ian Keefer
*/
public class TestPlayingState
{
/**
* tests the initlization of playing state
*/
@Test
public void testInitlization()
{
Memory.reset();
Memory m = Memory.getInstance();
MemoryState state = new PlayingState(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 PlayingState(m);
m.setState(state);
state.handle();
assertTrue(m.getState() instanceof EndGameState);
}
}