-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking βSign up for GitHubβ, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
π 2λ¨κ³ - μκ°μ μ²(λλ©μΈ λͺ¨λΈ) #326
Open
choomi1217
wants to merge
13
commits into
next-step:choomi1217
Choose a base branch
from
choomi1217:step2
base: choomi1217
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+355
β45
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
14b0c5a
refactor: `this` μ κ±°
choomi1217 797ab27
refactor: `saveAll(Question question, List<Answer> answers)` μ κ±°
choomi1217 b2ad421
refactor: `sdeleteQuestionAndRelatedAnswer` μμ±, `deleteQuestion` privβ¦
choomi1217 4ea825a
refactor: `deleteQuestion` μ½λ μ 리μ±
choomi1217 f60212f
test: `sdeleteQuestionAndRelatedAnswer` ν
μ€νΈ
choomi1217 576e809
docs: μκ° μ μ² κΈ°λ₯ μꡬμ¬ν μΆκ°
choomi1217 7bf5620
docs: μκ° μ μ² κΈ°λ₯ μꡬμ¬ν μΆκ°
choomi1217 aeb027f
feat: Session μΆκ°
choomi1217 8a9d570
feat: Session μΆκ°
choomi1217 92c1694
feat: `Period` μΆκ°
choomi1217 b677380
feat: `SessionImage` μΆκ°
choomi1217 ef71cd2
feat: `SessionType` μΆκ°
choomi1217 89a679b
test: `SessionType` Test
choomi1217 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
42 changes: 42 additions & 0 deletions
42
src/test/java/nextstep/courses/domain/SessionTypeTest.java
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,42 @@ | ||
package nextstep.courses.domain; | ||
|
||
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; | ||
import static org.assertj.core.api.Assertions.assertThatNoException; | ||
|
||
import org.junit.jupiter.api.DisplayName; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class SessionTypeTest { | ||
|
||
@DisplayName("λ¬΄λ£ κ°μλ λꡬλ μκ°μ μ²μ΄ κ°λ₯ν©λλ€.") | ||
@Test | ||
void a() { | ||
FreeSessionType freeSessionType = new FreeSessionType(); | ||
assertThatNoException().isThrownBy(freeSessionType::registered); | ||
} | ||
|
||
@DisplayName("2λͺ μ΄ μ΅λ μ μμΈ μ λ£ κ°μλ μ΅λ μκ° μΈμμ μ΄κ³Όν μ μμ΅λλ€.") | ||
@Test | ||
void b() { | ||
long pirce = 10_000; | ||
int maximumHeadCount = 100; | ||
PaidSessionType paidSessionType = new PaidSessionType(maximumHeadCount, pirce); | ||
|
||
assertThatNoException().isThrownBy(() -> paidSessionType.registered(pirce, 99)); | ||
assertThatIllegalArgumentException().isThrownBy(() -> paidSessionType.registered(pirce, 100)); | ||
assertThatIllegalArgumentException().isThrownBy(() -> paidSessionType.registered(pirce, 101)); | ||
} | ||
|
||
@DisplayName("μ λ£ κ°μλ κ²°μ κΈμ΄ κ°μλ£μ κ°μμΌ μκ°μ μ²μ΄ κ°λ₯ν©λλ€.") | ||
@Test | ||
void c() { | ||
long pirce = 10_000; | ||
int maximumHeadCount = 2; | ||
PaidSessionType paidSessionType = new PaidSessionType(maximumHeadCount, pirce); | ||
|
||
assertThatNoException().isThrownBy(() -> paidSessionType.registered(pirce, 1)); | ||
assertThatIllegalArgumentException().isThrownBy(() -> paidSessionType.registered(1000, 1)); | ||
} | ||
|
||
|
||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
λ±λ‘ κ°λ₯νμ§ νμΈνλ λΆλΆμ μΆμννλ©΄ μ’μ κ² κ°μμ! μ§κΈμ μΈν°νμ΄μ€μ λ©μλκ° νλλ μλ κ² κ°μμμ..!
λμκ°μ κ·Έλ° λλμ΄ λλ€λ©΄ sessionTypeμ EnumμΌλ‘ κ΄λ¦¬ν΄λ μ’μ§ μμκΉμ ?
μ§κΈμ SessionTypeμ DBλ‘ κ΄λ¦¬νλ €λ©΄ μλ λ³λμ λλ©μΈμ΄ λμ΄μΌ ν κ² κ°μμ!