Skip to content
Snippets Groups Projects
Commit 8deae106 authored by Yghore's avatar Yghore
Browse files

Test add

parent 6205e5fa
No related branches found
No related tags found
No related merge requests found
Pipeline #10499 failed
package fr.nancy.iut; package fr.nancy.iut;
import static org.junit.jupiter.api.Assertions.*; import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import javax.vecmath.Point3d; import javax.vecmath.Point3d;
...@@ -8,10 +10,49 @@ import javax.vecmath.Point3d; ...@@ -8,10 +10,49 @@ import javax.vecmath.Point3d;
* Created by dparsons on 12/08/15. * Created by dparsons on 12/08/15.
*/ */
public class SphereTest { public class SphereTest {
private Sphere sphere, sphere1;
@BeforeEach
public void before()
{
this.sphere = new Sphere(1.5);
this.sphere1 = new Sphere(2);
}
@Test @Test
public void testComputeVolume() throws Exception { public void testComputeVolume() throws Exception {
Sphere mySphere = new Sphere(1.5); assertEquals(14.137166941154069, sphere.computeVolume(), 0.0);
assertEquals(14.137166941154069, mySphere.computeVolume(), 0.0); }
@Test
public void testDistanceTo()
{
assertEquals(0, sphere.distanceTo(sphere1), 0.0);
}
@Test
public void testDistanceSquaredTo()
{
assertEquals(0, sphere.distanceTo(sphere1), 0.0);
}
@Test
public void testContact()
{
assertEquals(true, sphere.distanceTo(sphere1));
}
@Test
public void testConstructeur()
{
Sphere sp = new Sphere(0.5);
assertEquals(0.5, sp.radius_);
assertEquals(0, sp.pos_.x);
assertEquals(0, sp.pos_.y);
assertEquals(0, sp.pos_.z);
} }
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment