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
1514025e
Commit
1514025e
authored
2 years ago
by
Almasty007
Browse files
Options
Downloads
Patches
Plain Diff
ajout des tests
parent
2f86a69b
No related branches found
No related tags found
No related merge requests found
Pipeline
#10495
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
+30
-0
30 additions, 0 deletions
src/test/java/fr/nancy/iut/SphereTest.java
with
30 additions
and
0 deletions
src/test/java/fr/nancy/iut/SphereTest.java
+
30
−
0
View file @
1514025e
...
@@ -12,6 +12,7 @@ public class SphereTest {
...
@@ -12,6 +12,7 @@ public class SphereTest {
public
void
testComputeVolume
()
throws
Exception
{
public
void
testComputeVolume
()
throws
Exception
{
Sphere
mySphere
=
new
Sphere
(
1.5
);
Sphere
mySphere
=
new
Sphere
(
1.5
);
assertEquals
(
9.42477796076938
,
mySphere
.
computeVolume
(),
0.0
);
assertEquals
(
9.42477796076938
,
mySphere
.
computeVolume
(),
0.0
);
}
}
@Test
@Test
...
@@ -19,6 +20,35 @@ public class SphereTest {
...
@@ -19,6 +20,35 @@ public class SphereTest {
Sphere
mySphere
=
new
Sphere
(
1
,
new
Point3d
(
10
,
15
,
5
));
Sphere
mySphere
=
new
Sphere
(
1
,
new
Point3d
(
10
,
15
,
5
));
Sphere
mySphere2
=
new
Sphere
(
1
,
new
Point3d
(
10
,
15
,
6
));
Sphere
mySphere2
=
new
Sphere
(
1
,
new
Point3d
(
10
,
15
,
6
));
assertEquals
(
1
,
mySphere
.
distanceSquaredTo
(
mySphere2
));
assertEquals
(
1
,
mySphere
.
distanceSquaredTo
(
mySphere2
));
assertEquals
(
1
,
mySphere
.
distanceTo
(
mySphere2
));
}
@Test
public
void
testContact
()
throws
Exception
{
Sphere
mySphere
=
new
Sphere
(
1
,
new
Point3d
(
10
,
15
,
5
));
Sphere
mySphere2
=
new
Sphere
(
1
,
new
Point3d
(
10
,
15
,
6
));
Sphere
mySphere3
=
new
Sphere
(
1
,
new
Point3d
(
100
,
15
,
6
));
assertEquals
(
true
,
mySphere2
.
inContactWith
(
mySphere2
)
);
assertEquals
(
false
,
mySphere2
.
inContactWith
(
mySphere3
)
);
Sphere
mySphere4
=
new
Sphere
(
1
);
Sphere
mySphere5
=
new
Sphere
(
1
);
assertEquals
(
true
,
mySphere4
.
inContactWith
(
mySphere5
));
}
}
@Test
public
void
testGetters
()
throws
Exception
{
Sphere
mySphere
=
new
Sphere
(
1
,
new
Point3d
(
10
,
15
,
5
));
assertEquals
(
new
Point3d
(
10
,
15
,
5
),
mySphere
.
getPos
());
assertEquals
(
1
,
mySphere
.
getRadius
());
}
@Test
public
void
testCreerCercle
()
throws
Exception
{
Sphere
s1
=
new
Sphere
();
assertEquals
(
0
,
s1
.
getRadius
());
assertEquals
(
new
Point3d
(),
s1
.
getPos
());
}
}
}
\ 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