Skip to content
Snippets Groups Projects
Commit 3c7aee90 authored by GHITA999's avatar GHITA999
Browse files

debut02

parent 709602b2
No related branches found
No related tags found
No related merge requests found
......@@ -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");
}
}
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;
}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment