forked from nus-cs2113-AY2223S2/tp
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from sriram-senthilkr/feature_branch
Add Junit tests and added 2122 getInfo changes
- Loading branch information
Showing
4 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,5 @@ public static String getDetails(String module) { | |
return "This information is not available"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 66 additions & 1 deletion
67
src/test/java/seedu/penus/logic/utils/ModuleRetrieverTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,70 @@ | ||
package seedu.penus.logic.utils; | ||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
class ModuleRetrieverTest { | ||
public class ModuleRetrieverTest { | ||
|
||
@Test | ||
void testGetDescription() { | ||
String module = "CS2103T"; | ||
String expectedDescription = "This module introduces the necessary conceptual and analytical tools for " + | ||
"systematic and rigorous development of software systems. It covers four main areas of software development, " + | ||
"namely object-oriented system analysis, object-oriented system modelling and design, implementation, and testing, " + | ||
"with emphasis on system modelling and design and implementation of software modules that work cooperatively to " + | ||
"fulfill the requirements of the system. Tools and techniques for software development, such as Unified Modelling Language (UML)," + | ||
" program specification, and testing methods, will be taught. Major software engineering issues such as modularisation criteria, " + | ||
"program correctness, and software quality will also be covered."; | ||
|
||
assertEquals(expectedDescription, ModuleRetriever.getDescription(module)); | ||
} | ||
|
||
@Test | ||
void testGetPrerequisite() { | ||
String module = "CS2103T"; | ||
String expectedPrerequisite = "For SoC students only. (CS1020 or its equivalent) or CS2020 or ((CS2030 or its equivalent) and (CS2040 or its equivalent))"; | ||
|
||
assertEquals(expectedPrerequisite, ModuleRetriever.getPrerequisite(module)); | ||
} | ||
|
||
@Test | ||
void testGetTitle2223() { | ||
String module = "CS2103T"; | ||
String expectedTitle = "Software Engineering"; | ||
|
||
assertEquals(expectedTitle, ModuleRetriever.getTitle2223(module)); | ||
} | ||
|
||
@Test | ||
void testGetModuleCredit2223() { | ||
String module = "CS2103T"; | ||
String expectedModuleCredit = "4"; | ||
|
||
assertEquals(expectedModuleCredit, ModuleRetriever.getModuleCredit2223(module)); | ||
} | ||
|
||
@Test | ||
void testGetTitle2122() { | ||
String module = "CS2103T"; | ||
String expectedTitle = "Software Engineering"; | ||
|
||
assertEquals(expectedTitle, ModuleRetriever.getTitle2122(module)); | ||
} | ||
|
||
@Test | ||
void testGetModuleCredit2122() { | ||
String module = "CS2103T"; | ||
String expectedModuleCredit = "4"; | ||
|
||
assertEquals(expectedModuleCredit, ModuleRetriever.getModuleCredit2122(module)); | ||
} | ||
|
||
@Test | ||
void testGetSUstatus() { | ||
String module = "PF1101"; | ||
Boolean expectedSUstatus = true; | ||
|
||
assertEquals(expectedSUstatus, ModuleRetriever.getSUstatus(module)); | ||
} | ||
|
||
} | ||
|