improved test

This commit is contained in:
2018-03-08 17:50:53 +01:00
parent 5ce16f8793
commit 652a34e309
5 changed files with 50 additions and 23 deletions

View File

@@ -1,14 +1,12 @@
package worms.model;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
import worms.facade.Facade;
import worms.facade.IFacade;
import worms.model.Worm;
import worms.util.ModelException;
import static org.junit.Assert.assertEquals;
public class PartialFacadeTest {
private static final double EPS = 1e-4;

View File

@@ -2,24 +2,32 @@ package worms.model;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
import worms.util.Tuple;
class WormTest {
private Worm worm;
@BeforeEach
void setUp() {
worm = new Worm(Tuple.create(0.0, 0.0), 0, "Test", 1);
}
@Test
void getLocation() {
assertEquals(Tuple.create(0.0, 0.0), worm.getLocation());
}
@Test
void getOrientation() {
assertEquals(0, worm.getOrientation());
}
@Test
void getRadius() {
assertEquals(1, worm.getRadius());
}
@Test