Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sphere
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PIERRON Laurent
sphere
Commits
34fdd8ea
Commit
34fdd8ea
authored
2 years ago
by
Luquor
Browse files
Options
Downloads
Patches
Plain Diff
Couverture du code à 100%
parent
df21fc44
No related branches found
No related tags found
No related merge requests found
Pipeline
#10493
passed
2 years ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/test/java/fr/nancy/iut/SphereTest.java
+66
-6
66 additions, 6 deletions
src/test/java/fr/nancy/iut/SphereTest.java
with
66 additions
and
6 deletions
src/test/java/fr/nancy/iut/SphereTest.java
+
66
−
6
View file @
34fdd8ea
...
...
@@ -7,11 +7,71 @@ import javax.vecmath.Point3d;
/**
* Created by dparsons on 12/08/15.
*/
public
class
SphereTest
{
@Test
public
void
testComputeVolume
()
throws
Exception
{
Sphere
mySphere
=
new
Sphere
(
1.5
);
assertEquals
(
14.137166941154069
,
mySphere
.
computeVolume
(),
0.0
);
}
public
class
SphereTest
{
@Test
public
void
testConstructeurSansParametre
()
{
Sphere
s1
=
new
Sphere
();
assertEquals
(
0.0
,
s1
.
getRadius
(),
0.0
);
}
@Test
public
void
testContructeurParametre
()
{
Sphere
s1
=
new
Sphere
(
5.0
);
assertEquals
(
5.0
,
s1
.
getRadius
(),
0.0
);
}
@Test
public
void
testContructeurParametres
()
{
Sphere
s1
=
new
Sphere
(
5.0
,
new
Point3d
(
1.0
,
2.0
,
3.0
));
assertEquals
(
5.0
,
s1
.
getRadius
(),
0.0
);
assertEquals
(
1.0
,
s1
.
getPos
().
x
,
0.0
);
}
@Test
public
void
testComputeVolume
()
throws
Exception
{
Sphere
mySphere
=
new
Sphere
(
1.5
);
assertEquals
(
14.137166941154069
,
mySphere
.
computeVolume
(),
0.0
);
}
@Test
public
void
testDistanceTo
()
throws
Exception
{
Sphere
s1
=
new
Sphere
(
1.5
,
new
Point3d
(
1.0
,
2.0
,
3.0
));
Sphere
autre
=
new
Sphere
(
1.5
,
new
Point3d
(
2.0
,
3.0
,
4.0
));
assertEquals
(
1.7320508075688772
,
s1
.
distanceTo
(
autre
),
0.0
);
}
@Test
public
void
testDistanceSquaredTo
()
throws
Exception
{
Sphere
s1
=
new
Sphere
(
1.5
,
new
Point3d
(
1.0
,
2.0
,
3.0
));
Sphere
autre
=
new
Sphere
(
1.5
,
new
Point3d
(
2.0
,
3.0
,
4.0
));
assertEquals
(
3.0
,
s1
.
distanceSquaredTo
(
autre
),
0.0
);
}
@Test
public
void
testInContactWithTrue
()
throws
Exception
{
Sphere
s1
=
new
Sphere
(
1.5
,
new
Point3d
(
1.0
,
2.0
,
3.0
));
Sphere
autre
=
new
Sphere
(
1.5
,
new
Point3d
(
2.0
,
3.0
,
4.0
));
assertTrue
(
s1
.
inContactWith
(
autre
));
}
@Test
public
void
testInContactWithFalse
()
throws
Exception
{
Sphere
s1
=
new
Sphere
(
1.5
,
new
Point3d
(
1.0
,
2.0
,
3.0
));
Sphere
autre
=
new
Sphere
(
1
,
new
Point3d
(
10.0
,
50.0
,
40.0
));
assertFalse
(
s1
.
inContactWith
(
autre
));
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment