@Test public void gettingNonExistentCourse() { assertEquals(null, dao.getCourseByName("asdasdasd")); }
public Course getCourseByName(String name) { for (Course course : courses) { if (course.getName().equals(name)) { return course; } } return null; }
CourseDAO { public Course getCourseByName(String name) { for (Course course : courses) { if (course.getName().equals(name)) { return course; } } return null; } }
CourseDAO { public Course getCourseByName(String name) { for (Course course : courses) { if (course.getName().equals(name)) { return course; } } return null; } CourseDAO(DataSource<Course> dataSource); }
CourseDAO { public Course getCourseByName(String name) { for (Course course : courses) { if (course.getName().equals(name)) { return course; } } return null; } CourseDAO(DataSource<Course> dataSource); void loadCourses(); List<Course> getCourses(); void setCourses(List<Course> courses); void updateCourse(Course course); Course getCurrentCourse(Settings settings); Course getCourseByName(String name); }
CourseDAO { public Course getCourseByName(String name) { for (Course course : courses) { if (course.getName().equals(name)) { return course; } } return null; } CourseDAO(DataSource<Course> dataSource); void loadCourses(); List<Course> getCourses(); void setCourses(List<Course> courses); void updateCourse(Course course); Course getCurrentCourse(Settings settings); Course getCourseByName(String name);  }