-
Notifications
You must be signed in to change notification settings - Fork 0
/
FrontEndTest.java
34 lines (28 loc) · 1.03 KB
/
FrontEndTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Scanner;
public class FrontEndTest {
@Test
public void testEnterStudentMode() {
assertEquals(Frontend.printSMCommands(), "\\nStudent Mode:\\n <number>: returns a list of students with the test score of <number>\\n 'x': returns to the default menu\\n");
}
@Test
public void testEnterMathMode() {
assertEquals(Frontend.printMMCommands(), "\\nMath Mode:\\n Enter 'x' to return to default mode\\n");
}
@Test
public void testEnterMainMode() {
assertEquals(Frontend.printMainCommands(), "User Commands:\\n 's': enters student mode\\n 'm': enters math mode\\n 'q': exits the application");
}
@Test
public void testUseStudentMode() {
Scanner sc = new Scanner("69\nx");
String grade = Frontend.studentMode(sc);
assertEquals(grade, new Grade("Elliot Virtue", 43));
}
//couldnt figure out how to implement :/
@Test
public void testUseMathMode() {
assertEquals(":(", ":(");
}
}