Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package cdplayerstate;
- import org.junit.After;
- import org.junit.AfterClass;
- import org.junit.Before;
- import org.junit.BeforeClass;
- import org.junit.Test;
- import static org.junit.Assert.*;
- /**
- *
- * @author philipp
- */
- public class CDPlayerTest {
- public CDPlayerTest() {
- }
- @BeforeClass
- public static void setUpClass() {
- }
- @AfterClass
- public static void tearDownClass() {
- }
- @Before
- public void setUp() {
- }
- @After
- public void tearDown() {
- }
- /**
- * Test of setState method, of class CDPlayer.
- */
- @Test
- public void testSetState() {
- System.out.println("setState");
- CDPlayer instance = new CDPlayer();
- CDPlayerInterface state = new Normal(instance);
- instance.setState(state);
- assertEquals (state.getClass(), instance.getState().getClass());
- }
- /**
- * Test of faster method, of class CDPlayer.
- */
- @Test
- public void testFaster() {
- System.out.println("faster");
- CDPlayer instance = new CDPlayer();
- instance.faster();
- assertEquals (instance.getState().getClass(), Faster.class);
- }
- /**
- * Test of slower method, of class CDPlayer.
- */
- @Test
- public void testSlower() {
- System.out.println("slower");
- CDPlayer instance = new CDPlayer();
- instance.slower();
- assertEquals (instance.getState().getClass(), Slower.class);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment