![](/img/trans.png)
[英]Do I need to test each implementation of an interface to test the interface?
[英]Do I need an implementation of a third party interface to be able to complete my code?
我得到了一個要完成的項目,它本身很簡單。
基本上,我得到了一個名為CourseEligibility
的接口,我需要實現該接口( CourseEligibilityImpl
)。 並且有一個名為CourseExplorer
的外部接口。
我實現的類將有一個稱為
canEnrollOnCourse(int studentYear, String courseCode).
並且外部接口具有稱為
getCourseYear(String courseCode)
這一切都相當簡單,但我要實現CourseExplorer
類或我怎么回事,可以用它的抽象方法在我CourseEligibilityImpl
類?
CourseExplorer
應該是一個外部課程,應該由另一個團隊來進行。
聽起來您的CourseEligibility應該具有基本類型CourseExplorer的成員變量。 然后,它將使用CourseExplorer的任何實現。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.