Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
2
2_MOUBARIK_GHITA_2_ELATRAS_GUFRAN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MOUBARIK Ghita
2_MOUBARIK_GHITA_2_ELATRAS_GUFRAN
Commits
3c7aee90
Commit
3c7aee90
authored
4 years ago
by
GHITA999
Browse files
Options
Downloads
Patches
Plain Diff
debut02
parent
709602b2
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
tp1/TeachingUnitResult.java
+2
-0
2 additions, 0 deletions
tp1/TeachingUnitResult.java
tp1/TestTeachingUnitResult.java
+35
-0
35 additions, 0 deletions
tp1/TestTeachingUnitResult.java
with
37 additions
and
0 deletions
tp1/TeachingUnitResult.java
+
2
−
0
View file @
3c7aee90
...
...
@@ -26,6 +26,7 @@ public class TeachingUnitResult {
* @return the grade associated to the result
*/
public
Grade
getGrade
()
{
return
grade
;
}
/**
...
...
@@ -34,5 +35,6 @@ public class TeachingUnitResult {
*/
@Override
public
String
toString
()
{
return
(
teachingUnitName
+
" : "
+
grade
+
":20"
);
}
}
This diff is collapsed.
Click to expand it.
tp1/TestTeachingUnitResult.java
0 → 100644
+
35
−
0
View file @
3c7aee90
import
java.util.ArrayList
;
public
class
TestTeachingUnitResult
{
public
static
void
main
(
String
[]
args
){
TestTeachingUnitResult
test
=
new
TestTeachingUnitResult
();
if
(
test
.
testToString
()
==
true
)
System
.
out
.
println
(
"testToString : correct"
);
else
System
.
out
.
println
(
"testToString : incorrect"
);
if
(
test
.
testGetGrade
()
==
true
)
System
.
out
.
println
(
"testGetGrade : correct"
);
else
System
.
out
.
println
(
"testGetGrade : incorrect"
);
}
private
boolean
testGetGrade
()
{
Grade
grade
=
new
Grade
(
12.5
);
double
val
=
grade
.
getValue
();
if
(
val
==
12.5
)
return
true
;
else
return
false
;
}
private
boolean
testToString
(){
Grade
grade
=
new
Grade
(
16.80
);
String
gradeString
=
grade
.
toString
();
if
(
gradeString
.
equals
(
"16;80/20"
))
return
true
;
else
return
false
;
}}
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