Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Commit

Permalink
test: added getAll test for SkillService
Browse files Browse the repository at this point in the history
  • Loading branch information
MaartenS11 committed Apr 22, 2022
1 parent bc2fab7 commit 4f59f3e
Showing 1 changed file with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package be.osoc.team1.backend.unittests

import be.osoc.team1.backend.entities.Skill
import be.osoc.team1.backend.repositories.SkillRepository
import be.osoc.team1.backend.services.SkillService
import io.mockk.every
import io.mockk.mockk
import org.junit.jupiter.api.Assertions
import org.junit.jupiter.api.Test

class SkillServiceTests {

@Test
fun `getAll succeeds`() {
val repository: SkillRepository = mockk()
val skill = Skill("Back-end")
val skills = listOf(skill)
every { repository.findAll() } returns skills
val service = SkillService(repository)
Assertions.assertEquals(skills, service.getAll())
}
}

0 comments on commit 4f59f3e

Please sign in to comment.