-
Notifications
You must be signed in to change notification settings - Fork 0
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
test: Playback Interactor, Presenter 테스트 코드 작성 #320
Conversation
뷰는 테스트 안해주셔도 됩니다! |
iOS/Layover/LayoverTests/Mocks/Workers/MockPlaybackWorekr.swift
Outdated
Show resolved
Hide resolved
iOS/Layover/LayoverTests/Scenes/Playback/PlaybackInteractorTests.swift
Outdated
Show resolved
Hide resolved
if post.board.videoURL == nil { | ||
continue | ||
} | ||
tempVideos.append(post) |
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.
if let 써서 videoURL있을 때만 append하는게 더 직관적일 것 같은 느낌?
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.
재생화면이 케이스가 엄청 많네요.. 고생하셨습니다
빌드 fail하는 테케는 머지하시고 고치실 예정인가요 !
@anyukyung 아뇨 지금 최대한 고쳐볼게용.... |
|
||
// MARK: - Tests | ||
|
||
func test_displayVideoList를_호출하면_presentVideoList를_호출하고_올바른_데이터를_전달한다_parentView가_map일_때() async { |
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.
자연스럽게 읽힐 수 있도록 ~~일 때 라는 말이 어순으로 들어오면 좋을 것 같습니다
// videos는 Hashable | ||
XCTAssertEqual(spy.displayVideoListViewModel.videos.first!, Seeds.PlaybackVideos.videos.first!) | ||
XCTAssertEqual(spy.displayVideoListViewModel.videos.last!, Seeds.PlaybackVideos.videos.last!) | ||
XCTAssertEqual(spy.displayVideoListViewModel.videos.count, 2) |
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.
count 체크가 선행되어서, 실패 시 뒤 로직을 실행하지 못하게 하면 테스트 시간을 단축할 수 있을 것 같습니다.
let response: Models.SeekVideo.Response = Models.SeekVideo.Response(willMoveLocation: willMoveLocation, currentCell: previousCell) | ||
presenter?.presentSeekVideo(with: response) | ||
} | ||
|
||
func hidePlayerSlider() { | ||
guard let previousCell else { return } | ||
previousCell.playbackView.playerSlider?.isHidden = true |
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.
이건 interactor에서 뷰를 조작하는 동작일까요...?
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.
고생하셨습니다. 테스트 케이스가 너무 많군요....ㅠㅠ
@loinsir @anyukyung 저 이 브랜치 Pr 닫고 브랜치 새로 파서 진행할게요. 어디서부터 꼬였는지 감도 안잡혀요 지금 |
🧑🚀 PR 요약
�Playback Interacotr와 Presenter의 테스트 코드를 작성했습니다.
ViewController는 아직 못했습니다. 정신 나갈것 같아요.
구조이슈........로 테스트 안되는 케이스들이 두갠가 있습니다.
이 친구들은 버그 고치고, 정신 좀 말짱할 때 할 게요.
📸 ScreenShot
Linked Issue
close #311