-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor: 카테고리, 일시 선택 순서 변경 및 리팩터링 (스타카토 생성/수정) #564 #566
Closed
Conversation
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
변수명 변경 및 public 함수 리팩터링
- initMemoryAndVisitedAt() : memoryId에 따라 일시, 추억을 초기화 - setMemoryCandidateByVisitedAt() : 일시에 따라 추억을 설정
- initMemoryAndVisitedAt() : 스타카토에 따라 일시, 추억을 초기화 - setMemoryCandidateByVisitedAt() : 일시에 따라 추억을 설정
s6m1n
added
android
We are android><
refactor
리팩토링 (변수 및 메서드 네이밍 변경)
✅ test
테스트 (테스트 코드 추가, 수정, 삭제: 비즈니스 로직에 변경 없음)
labels
Dec 8, 2024
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
⭐️ Issue Number
564🚩 Summary
스타카토 생성/수정 화면의 카테고리, 일시 관련 로직에 아래의 작업들을 수행했습니다.
리팩터링 내용 정리
생성 화면
fetchMemoryCandidates()
로 사용자의 모든 추억을 불러와_memoryCandidates
를 업데이트 합니다._memoryCandidates
는 최초 한 번 업데이트된 후엔 변하지 않습니다.memoryCandidates.observe
람다에서initMemoryAndVisitedAt()
를 수행하여 일시, 추억의 초기값을 세팅합니다.LocalDateTime.now()
(선택 가능한 일시 범위는 selectedVisitedAt ±10년)updateMemoryCandidateAndVisitedAt()
MemoryCandidate
의getClosestDateTime()
참고)수정 화면
fetchMemoryCandidates()
)fetchStaccatoBy()
)🛠️ Technical Concerns
스타카토 생성/수정 ViewModel 테스트
MVVM 구조의 뷰모델 내부 LiveData 값을 테스트하기 위해 아래 Rule을 설정하고 getOrAwaitValue를 추가했습니다.
또한 mockK의 coEvery와 coroutines.test의 runTest를 사용했습니다.
🙂 To Reviewer