package franck.pingpong; import org.junit.Assert; import org.junit.Test; /** * Tests PingPongModel class. * * @author Franck van Breugel */ public class PingPongModelTest { /** * Tests that the constructor terminates and does not crash. */ @Test(timeout=1000) public void testConstructor() { PingPongModel model = new PingPongModel(); } /** * Tests the getPingOrPong method. */ @Test(timeout=1000) public void testGetPingOrPong() { PingPongModel model = new PingPongModel(); Assert.assertEquals("first invocation of getPingOrPong", "Ping", model.getPingOrPong()); Assert.assertEquals("second invocation of getPingOrPong", "Pong", model.getPingOrPong()); Assert.assertEquals("third invocation of getPingOrPong", "Ping", model.getPingOrPong()); Assert.assertEquals("fourth invocation of getPingOrPong", "Pong", model.getPingOrPong()); Assert.assertEquals("fifth invocation of getPingOrPong", "Ping", model.getPingOrPong()); Assert.assertEquals("sixth invocation of getPingOrPong", "Pong", model.getPingOrPong()); Assert.assertEquals("seventh invocation of getPingOrPong", "Ping", model.getPingOrPong()); Assert.assertEquals("eight invocation of getPingOrPong", "Pong", model.getPingOrPong()); Assert.assertEquals("nineth invocation of getPingOrPong", "Ping", model.getPingOrPong()); Assert.assertEquals("tenth invocation of getPingOrPong", "Pong", model.getPingOrPong()); } }