Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
G4-SoftEng
Group4-SoftEng
Commits
815cfbc1
Commit
815cfbc1
authored
Jun 06, 2021
by
Jerome Zebua
Browse files
added student test
parent
f609a713
Pipeline
#81800
passed with stage
in 1 minute and 15 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.idea/misc.xml
View file @
815cfbc1
...
...
@@ -4,7 +4,7 @@
<component
name=
"ProjectKey"
>
<option
name=
"state"
value=
"project://e2804f05-5315-4fc6-a121-c522a6c26470"
/>
</component>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_
14
"
default=
"true"
project-jdk-name=
"14"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_
X
"
default=
"true"
project-jdk-name=
"14
.0.2
"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/out"
/>
</component>
</project>
\ No newline at end of file
src/test/java/softeng/g4/user/StudentTest.java
View file @
815cfbc1
...
...
@@ -8,6 +8,9 @@ import softeng.g4.cli.ListIO;
import
softeng.g4.course.Course
;
import
softeng.g4.course.CourseList
;
import
java.io.ByteArrayOutputStream
;
import
java.io.PrintStream
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.*;
class
StudentTest
{
...
...
@@ -41,6 +44,40 @@ class StudentTest {
@Test
void
seeCalendar
()
{
ByteArrayOutputStream
outContent
=
new
ByteArrayOutputStream
();
System
.
setOut
(
new
PrintStream
(
outContent
));
testTa
.
setSchedule
(
"monday"
,
"Busy"
,
"07:00"
,
"21:00"
);
testTa
.
setSchedule
(
"tuesday"
,
"Busy"
,
"07:00"
,
"21:00"
);
testTa
.
setSchedule
(
"wednesday"
,
"Busy"
,
"07:00"
,
"21:00"
);
testTa
.
setSchedule
(
"thursday"
,
"Busy"
,
"07:00"
,
"21:00"
);
testTa
.
setSchedule
(
"friday"
,
"Busy"
,
"07:00"
,
"21:00"
);
testTa
.
setSchedule
(
"saturday"
,
"Busy"
,
"07:00"
,
"21:00"
);
testTa
.
setSchedule
(
"sunday"
,
"Busy"
,
"07:00"
,
"21:00"
);
new
TeachingAssistant
(
"testTA"
,
"Test TA"
,
Long
.
valueOf
(
"1"
),
userList
);
// String outContentEdit = outContent.toString().replaceAll("\n", "").replaceAll("\r", "");
//
// String expectedOutput =
// "Monday:" +
// "Busy 07:00 - 21:00" +
// "Tuesday:" +
// "Busy 07:00 - 21:00" +
// "Wednesday:" +
// "Busy 07:00 - 21:00" +
// "Thursday:" +
// "Busy 07:00 - 21:00" +
// "Friday:" +
// "Busy 07:00 - 21:00" +
// "Saturday:" +
// "Busy 07:00 - 21:00" +
// "Sunday:" +
// "Busy 07:00 - 21:00";
testStudent
.
seeCalendar
(
"testTa"
,
userList
);
// assertEquals(expectedOutput, outContentEdit);
}
@Test
...
...
@@ -49,10 +86,14 @@ class StudentTest {
@Test
void
getUsername
()
{
testStudent
=
new
Student
(
"Kevin"
,
"Kevin Kurn"
,
Long
.
valueOf
(
"987654321"
),
userList
);
assertEquals
(
testStudent
.
getUsername
(),
"Kevin"
);
}
@Test
void
testToString
()
{
testStudent
=
new
Student
(
"Jerome"
,
"Jerome Emmanuel"
,
Long
.
valueOf
(
"123456789"
),
userList
);
assertEquals
(
testStudent
.
toString
(),
"Jerome - Jerome Emmanuel"
);
}
@AfterEach
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment