Add tests to eduOne homework

This commit is contained in:
Mikołaj Pich 2024-03-19 20:18:18 +01:00
parent 8428eb6ce9
commit 5cbe97b9a0
No known key found for this signature in database

View file

@ -0,0 +1,41 @@
package io.github.wulkanowy.sdk.scrapper.homework
import io.github.wulkanowy.sdk.scrapper.BaseLocalTest
import kotlinx.coroutines.runBlocking
import org.junit.Assert
import org.junit.Test
class HomeworkPlusTest : BaseLocalTest() {
private val homework by lazy {
runBlocking {
getStudentPlusRepo {
it.enqueue("SprawdzianyZadaniaDomowe.json", HomeworkPlusTest::class.java)
it.enqueue("ZadanieDomoweSzczegoly.json", HomeworkPlusTest::class.java)
}.getHomework(
startDate = getLocalDate(2024, 10, 18),
endDate = getLocalDate(2024, 3, 24),
studentId = 1,
diaryId = 2,
unitId = 3,
)
}
}
@Test
fun getAllTest() {
Assert.assertEquals(1, homework.size)
}
@Test
fun getHomeworkTest() {
with(homework[0]) {
Assert.assertEquals(getDate(2024, 3, 19), date)
Assert.assertEquals(getDate(2024, 3, 19), entryDate)
Assert.assertEquals("Zajęcia artystyczne", subject)
Assert.assertEquals("opis zadania", content)
Assert.assertEquals("Jan Kowalski", teacher)
Assert.assertEquals("", teacherSymbol)
}
}
}