Skip to content

Commit

Permalink
test: 역량 키워드 도메인 로직 테스트 코드 추가(#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
whereami2048 committed May 17, 2024
1 parent 3cd3600 commit 916f7e2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Domain-Module/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dependencies {
//web
implementation("org.springframework.boot:spring-boot-starter-web")
implementation(project(":Support-Module:uuid"))
}
testImplementation(testFixtures(project(":Common-Module")))
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.bamyanggang.domainmodule.strongpoint.aggregate

import com.bamyanggang.commonmodule.fixture.generateFixture
import com.bamyanggang.domainmodule.domain.strongpoint.aggregate.StrongPoint
import io.kotest.assertions.throwables.shouldThrow
import io.kotest.core.spec.style.FunSpec
import io.kotest.matchers.shouldBe
import java.util.*

class StrongPointTest: FunSpec({
val userId: UUID = generateFixture()

test("역량 키워드 정상 생성 테스트") {
//arange
val name = "역량 키워드"
val newStrongPoint = StrongPoint.create(name, userId)

newStrongPoint.name shouldBe name
newStrongPoint.userId shouldBe userId
}

test("이름 공백 역량 키워드 등록 예외 테스트"){
shouldThrow<IllegalArgumentException> {
StrongPoint.create("", userId)
}
}

test("역량 키워드 이름 중복 검증 테스트") {
val name = "중복 역량 키워드"
val originStrongPoint = StrongPoint.create(name, userId)

originStrongPoint.isDuplicated(name) shouldBe true
}

})

0 comments on commit 916f7e2

Please sign in to comment.