This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
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
64278ff
commit 13f01f4
Showing
4 changed files
with
42 additions
and
3 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
19 changes: 19 additions & 0 deletions
19
support/common/src/test/kotlin/com/studentcenter/weave/support/common/vo/EmailTest.kt
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,19 @@ | ||
package com.studentcenter.weave.support.common.vo | ||
|
||
import io.kotest.assertions.throwables.shouldThrow | ||
import io.kotest.core.spec.style.FunSpec | ||
|
||
class EmailTest: FunSpec({ | ||
|
||
test("이메일 주소가 올바른 형식이 아닌 경우 예외가 발생한다.") { | ||
val invalidEmail = "invalid_email" | ||
shouldThrow<IllegalArgumentException> { | ||
Email(invalidEmail) | ||
} | ||
} | ||
|
||
test("이메일 주소가 올바른 형식인 경우 객체가 생성된다.") { | ||
val validEmail = "[email protected]" | ||
Email(validEmail) | ||
} | ||
}) |
20 changes: 20 additions & 0 deletions
20
support/common/src/test/kotlin/com/studentcenter/weave/support/common/vo/UrlTest.kt
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,20 @@ | ||
package com.studentcenter.weave.support.common.vo | ||
|
||
import io.kotest.assertions.throwables.shouldThrow | ||
import io.kotest.core.spec.style.FunSpec | ||
|
||
class UrlTest : FunSpec({ | ||
|
||
test("URL 형식이 아닌 경우 예외가 발생한다.") { | ||
val invalidUrl = "invalid_url" | ||
shouldThrow<IllegalArgumentException> { | ||
Url(invalidUrl) | ||
} | ||
} | ||
|
||
test("URL 형식인 경우 객체가 생성된다.") { | ||
val validUrl = "https://test.com" | ||
Url(validUrl) | ||
} | ||
|
||
}) |