Y2S1-Seabed_Explorer/test/state_pattern_tests/states/IdleStateTest.java

72 lines
1.7 KiB
Java
Raw Permalink Normal View History

2020-06-07 21:14:52 +00:00
package state_pattern_tests.states;
import org.junit.Test;
import static org.junit.Assert.*;
import seabedexplorer.submersible.ROV;
import seabedexplorer.submersible.equipment.locationtracking.Location;
import seabedexplorer.submersible.state.states.IdleState;
public class IdleStateTest {
@Test
public void IdleStateTestCanMove()
{
IdleState is = new IdleState();
assertTrue(is.canMove());
}
@Test
public void IdleStateTestMove()
{
IdleState is = new IdleState();
is.submersibleInstance(new ROV());
assertTrue(is.move(new Location(5, 5, 5)));
}
@Test
public void IdleStatesTestStopMove()
{
IdleState is = new IdleState();
assertFalse(is.stopMove());
}
@Test
public void IdleStateString()
{
IdleState is = new IdleState();
assertEquals(is.toString(), "Idle");
}
@Test
public void IdleStateReturnToVesel()
{
IdleState is = new IdleState();
is.submersibleInstance(new ROV());
assertTrue(is.returnToVessel());
}
@Test
public void IdleStateCollectWater()
{
IdleState is = new IdleState();
is.submersibleInstance(new ROV());
assertTrue(is.collectWater());
}
@Test
public void IdleStateCollectMaterial()
{
IdleState is = new IdleState();
is.submersibleInstance(new ROV());
assertTrue(is.collectMaterial());
}
@Test
public void IdleStateCollectMapping()
{
IdleState is = new IdleState();
is.submersibleInstance(new ROV());
assertTrue(is.collectMappingData());
}
}