Skip to content
Snippets Groups Projects
Commit 0bcbf939 authored by RANGHEARD Leo's avatar RANGHEARD Leo
Browse files

Correction Student et TestStudent, fin de TestCohort

testAddResults() délibérément fausse
parent b76bcfb0
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,7 @@ public class Student {
*/
@Override
public String toString() {
return firstName + lastName;
return firstName + " " + lastName;
}
......
import java.util.ArrayList;
import java.util.List;
public class TestCohort {
public static void main(String[] args){
TestCohort test = new TestCohort();
if (test.testGetStudents() == true)
System.out.println("testGetStudents = correct");
else
System.out.println("testGetStudents = incorrect");
if (test.testToString() == true)
System.out.println("testToString = correct");
else
System.out.println("testToString = incorrect");
}
public boolean testGetStudents(){
List<Student> testStudents = new ArrayList<>();
Cohort testCohort = new Cohort("Programmation");
testStudents.add(new Student("Leo", "Rangheard"));
testStudents.add(new Student("Ahmed", "Souissi"));
testCohort.addStudent(new Student("Leo", "Rangheard"));
testCohort.addStudent(new Student("Ahmed", "Souissi"));
if (testCohort.getStudents().equals(testStudents))
return true;
else
return false;
}
public boolean testToString(){
Cohort testCohort = new Cohort("Programmation");
if (testCohort.toString().equals("Programmation"))
return true;
else
return false;
}
}
......@@ -24,11 +24,6 @@ public class TestStudent {
System.out.println("averageGrade = correct");
else
System.out.println("averageGrade = incorrect");
if (test.testPrintResults() == true)
System.out.println("printResults = correct");
else
System.out.println("printResults = incorrect");
}
public boolean testAddResult(){
Grade grade = new Grade(11.7);
......@@ -72,7 +67,4 @@ public class TestStudent {
else
return false;
}
public boolean testPrintResults(){
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment