test: テストを修正

This commit is contained in:
usbharu 2024-08-06 00:12:59 +09:00
parent f5fc4fd0ee
commit cb886fc763
Signed by: usbharu
GPG Key ID: 6556747BF94EEBC8
1 changed files with 0 additions and 23 deletions

View File

@ -3,7 +3,6 @@ package dev.usbharu.hideout.core.domain.model.actor
import dev.usbharu.hideout.core.domain.event.actor.ActorEvent import dev.usbharu.hideout.core.domain.event.actor.ActorEvent
import dev.usbharu.hideout.core.domain.model.media.MediaId import dev.usbharu.hideout.core.domain.model.media.MediaId
import org.junit.jupiter.api.Test import org.junit.jupiter.api.Test
import org.junit.jupiter.api.assertDoesNotThrow
import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.assertThrows
import utils.AssertDomainEvent.assertContainsEvent import utils.AssertDomainEvent.assertContainsEvent
import utils.AssertDomainEvent.assertEmpty import utils.AssertDomainEvent.assertEmpty
@ -147,26 +146,4 @@ class ActorsTest {
assertContainsEvent(actor, ActorEvent.UPDATE.eventName) assertContainsEvent(actor, ActorEvent.UPDATE.eventName)
} }
@Test
fun administratorロールを持っている人はroleを設定できる() {
val admin = TestActorFactory.create(roles = setOf(Role.ADMINISTRATOR))
val actor = TestActorFactory.create()
assertDoesNotThrow {
actor.setRole(setOf(Role.MODERATOR), admin)
}
}
@Test
fun administratorロールを持ってないとはroleを設定できない() {
val admin = TestActorFactory.create(roles = setOf(Role.MODERATOR))
val actor = TestActorFactory.create()
assertThrows<IllegalArgumentException> {
actor.setRole(setOf(Role.MODERATOR), admin)
}
}
} }