Skip to content
Snippets Groups Projects
Select Git revision
  • 11b6c68b5a2391a05a93f6c1c728cf210072b078
  • master default protected
  • sdas
3 results

TestCohort.java

Blame
  • Forked from NASR Alexis / Programmation2
    1 commit behind, 1 commit ahead of the upstream repository.
    user avatar
    Teo Blaise Kaplanski authored
    11b6c68b
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    TestCohort.java 1.54 KiB
    import java.util.ArrayList;
    import java.util.List;
    
    public class TestCohort {
    	public static void main(String[] args){
    		TestCohort test = new TestCohort();
    		if(test.testaddStudent() == true)
    		    System.out.println("testCohort : correct");
    		else
    		    System.out.println("testCohort : incorrect"); 
    
    		if(test.testToString() == true)
    		    System.out.println("testToString : correct");
    		else
    		    System.out.println("testToString : incorrect");
    		
    		if(test.testGetStudents() == true)
    		    System.out.println("testGetStudents : correct");
    		else
    		    System.out.println("testGetStudents : incorrect");
    			
    		
    		
    	    }
    	
    	public boolean testaddStudent(){
    		Student Mayombo = new Student("le mimi", "des mimis");
    		Cohort Programmation2 = new Cohort("Programmation 2");
    		 Programmation2.addStudent(Mayombo);
    		 List<Student> list = new ArrayList<Student>();
    		 list.add(new Student("le mimi", "des mimis"));
    		
    		 if(Programmation2.getStudents().equals(list))
    			 return true;
    			else
    				System.out.println(list);
    		 		System.out.println(Programmation2.getStudents());
    				return false;
    	}
    
    	public boolean testToString(){
    		Cohort binks = new Cohort("binks");
    		if (binks.toString().equals("binks"))
    			return true;
    		else
    			
    				return false;
    
    		}
    	
    	public boolean testGetStudents(){
    		Student LUV = new Student("Lil","Uzi");
    		Cohort Zoom = new Cohort("zoom");
    		Zoom.addStudent(LUV);
    		List<Student> get = new ArrayList<Student>();
    		get.add(new Student("Lil","Uzi"));
    		if(Zoom.getStudents().equals(get))
    			return true;
    		else
    				return false;
    		
    	}
    	
    	
    	
    }