-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f28b0b6
commit dd997a0
Showing
5 changed files
with
239 additions
and
30 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
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
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
188 changes: 188 additions & 0 deletions
188
...java/io/github/paexception/engelsburg/api/test/service/scheduled/SubstituteParseTest.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 |
---|---|---|
@@ -0,0 +1,188 @@ | ||
package io.github.paexception.engelsburg.api.test.service.scheduled; | ||
|
||
import io.github.paexception.engelsburg.api.endpoint.dto.SubstituteDTO; | ||
import io.github.paexception.engelsburg.api.service.scheduled.SubstituteUpdateService; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import java.sql.Date; | ||
import java.util.Objects; | ||
|
||
public class SubstituteParseTest { | ||
|
||
@Test | ||
public void testSubstituteParse() { | ||
new SubstituteUpdateService(null, null, null).updateSubstitutes(); | ||
} | ||
|
||
@Test | ||
public void substituteDTOEqualTest() { | ||
//Correct 5a - 10e | ||
SubstituteDTO dto1 = new SubstituteDTO( | ||
new Date(169879761), | ||
"10c", | ||
2, | ||
"M", | ||
"BSU", | ||
"GAR", | ||
"Vertretung", | ||
"Mo-21.2. / 4", | ||
"H301", | ||
"Aufg. vorhanden" | ||
); | ||
SubstituteDTO dto2 = new SubstituteDTO( | ||
new Date(169879761), | ||
"10c", | ||
2, | ||
"D", | ||
"GRB", | ||
"KLE", | ||
"Betreuung", | ||
"asg", | ||
"dshssdssh", | ||
"dshgdhsen" | ||
); | ||
|
||
assert Objects.equals(dto1, dto2); | ||
|
||
//Different lesson 5a - 10e | ||
SubstituteDTO dto3 = new SubstituteDTO( | ||
new Date(169879761), | ||
"10a", | ||
2, | ||
"M", | ||
"BSU", | ||
"GAR", | ||
"Vertretung", | ||
"Mo-21.2. / 4", | ||
"H301", | ||
"Aufg. vorhanden" | ||
); | ||
SubstituteDTO dto4 = new SubstituteDTO( | ||
new Date(169879761), | ||
"10c", | ||
3, | ||
"D", | ||
"GRB", | ||
"KLE", | ||
"Betreuung", | ||
"asg", | ||
"dshssdssh", | ||
"dshgdhsen" | ||
); | ||
|
||
assert !Objects.equals(dto3, dto4); | ||
|
||
//Different class | ||
SubstituteDTO dto5 = new SubstituteDTO( | ||
new Date(169879761), | ||
"Q3", | ||
2, | ||
"M", | ||
"BSU", | ||
"GAR", | ||
"Vertretung", | ||
"Mo-21.2. / 4", | ||
"H301", | ||
"Aufg. vorhanden" | ||
); | ||
SubstituteDTO dto6 = new SubstituteDTO( | ||
new Date(169879761), | ||
"10c", | ||
2, | ||
"D", | ||
"GRB", | ||
"KLE", | ||
"Betreuung", | ||
"asg", | ||
"dshssdssh", | ||
"dshgdhsen" | ||
); | ||
|
||
assert !Objects.equals(dto5, dto6); | ||
|
||
//Different date | ||
SubstituteDTO dto7 = new SubstituteDTO( | ||
new Date(169761), | ||
"10c", | ||
2, | ||
"M", | ||
"BSU", | ||
"GAR", | ||
"Vertretung", | ||
"Mo-21.2. / 4", | ||
"H301", | ||
"Aufg. vorhanden" | ||
); | ||
SubstituteDTO dto8 = new SubstituteDTO( | ||
new Date(169879761), | ||
"10c", | ||
2, | ||
"D", | ||
"GRB", | ||
"KLE", | ||
"Betreuung", | ||
"asg", | ||
"dshssdssh", | ||
"dshgdhsen" | ||
); | ||
|
||
assert !Objects.equals(dto7, dto8); | ||
|
||
//Different teacher E1 - Q4 | ||
SubstituteDTO dto9 = new SubstituteDTO( | ||
new Date(169761), | ||
"Q3", | ||
2, | ||
"M", | ||
"BSU", | ||
"GAR", | ||
"Vertretung", | ||
"Mo-21.2. / 4", | ||
"H301", | ||
"Aufg. vorhanden" | ||
); | ||
SubstituteDTO dto10 = new SubstituteDTO( | ||
new Date(169879761), | ||
"Q3", | ||
2, | ||
"D", | ||
"GRB", | ||
"KLE", | ||
"Betreuung", | ||
"asg", | ||
"dshssdssh", | ||
"dshgdhsen" | ||
); | ||
|
||
assert !Objects.equals(dto9, dto10); | ||
|
||
//Correct teacher E1 - Q4 | ||
SubstituteDTO dto11 = new SubstituteDTO( | ||
new Date(169761), | ||
"Q3", | ||
2, | ||
"M", | ||
"BSU", | ||
"GAR", | ||
"Vertretung", | ||
"Mo-21.2. / 4", | ||
"H301", | ||
"Aufg. vorhanden" | ||
); | ||
SubstituteDTO dto12 = new SubstituteDTO( | ||
new Date(169879761), | ||
"Q3", | ||
2, | ||
"D", | ||
"BSU", | ||
"KLE", | ||
"Betreuung", | ||
"asg", | ||
"dshssdssh", | ||
"dshgdhsen" | ||
); | ||
|
||
assert !Objects.equals(dto11, dto12); | ||
} | ||
|
||
} |