Skip to content

Commit

Permalink
✅ PlaybackInteractor Test 1차
Browse files Browse the repository at this point in the history
  • Loading branch information
chopmozzi committed Jan 8, 2024
1 parent 72e548a commit 166e756
Show file tree
Hide file tree
Showing 4 changed files with 666 additions and 5 deletions.
4 changes: 4 additions & 0 deletions iOS/Layover/Layover.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
835A61A62B0B4DDD002F22A5 /* Dashboard-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 835A61A52B0B4DDD002F22A5 /* Dashboard-Regular.ttf */; };
835A61A92B0B5A31002F22A5 /* LoginConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 835A61A82B0B5A31002F22A5 /* LoginConfigurator.swift */; };
8363A32D2B4C1CBB00772DDF /* PlaybackPresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8363A32C2B4C1CBA00772DDF /* PlaybackPresenterTests.swift */; };
8363A32F2B4C329100772DDF /* PlaybackInteractorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8363A32E2B4C329100772DDF /* PlaybackInteractorTests.swift */; };
836C33872B15A29600ECAFB0 /* Toast.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33862B15A29600ECAFB0 /* Toast.swift */; };
836C338B2B15D22C00ECAFB0 /* PlaybackConfigurator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C338A2B15D22C00ECAFB0 /* PlaybackConfigurator.swift */; };
836C33912B17629400ECAFB0 /* MapRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 836C33902B17629400ECAFB0 /* MapRouter.swift */; };
Expand Down Expand Up @@ -404,6 +405,7 @@
835A61A82B0B5A31002F22A5 /* LoginConfigurator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginConfigurator.swift; sourceTree = "<group>"; };
835A61AA2B0B85FD002F22A5 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/LaunchScreen.strings; sourceTree = "<group>"; };
8363A32C2B4C1CBA00772DDF /* PlaybackPresenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PlaybackPresenterTests.swift; path = LayoverTests/Mocks/Workers/PlaybackPresenterTests.swift; sourceTree = SOURCE_ROOT; };
8363A32E2B4C329100772DDF /* PlaybackInteractorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = PlaybackInteractorTests.swift; path = LayoverTests/Mocks/Workers/PlaybackInteractorTests.swift; sourceTree = SOURCE_ROOT; };
836C33862B15A29600ECAFB0 /* Toast.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Toast.swift; sourceTree = "<group>"; };
836C338A2B15D22C00ECAFB0 /* PlaybackConfigurator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlaybackConfigurator.swift; sourceTree = "<group>"; };
836C33902B17629400ECAFB0 /* MapRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapRouter.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -876,6 +878,7 @@
isa = PBXGroup;
children = (
8363A32C2B4C1CBA00772DDF /* PlaybackPresenterTests.swift */,
8363A32E2B4C329100772DDF /* PlaybackInteractorTests.swift */,
);
path = Playback;
sourceTree = "<group>";
Expand Down Expand Up @@ -1612,6 +1615,7 @@
19AE481A2B28C2B700DD4612 /* SettingPresenterTests.swift in Sources */,
19AE48172B28C2B700DD4612 /* SettingViewControllerTests.swift in Sources */,
194C21C32B1DEE6B00C62645 /* HomeViewControllerTests.swift in Sources */,
8363A32F2B4C329100772DDF /* PlaybackInteractorTests.swift in Sources */,
192513692B26F7CE001533FA /* TagPlayListInteractorTests.swift in Sources */,
19AE48232B29D03D00DD4612 /* EditProfileInteractorTests.swift in Sources */,
194C21CC2B1DF39200C62645 /* MockHomeWorker.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ final class PlaybackInteractor: PlaybackBusinessLogic, PlaybackDataStore {

private var currentPage: Int = 1

private var playbackVideoInfos: [Models.PlaybackInfo] = []
var playbackVideoInfos: [Models.PlaybackInfo] = []

// MARK: - UseCase Load Video List

Expand Down
13 changes: 9 additions & 4 deletions iOS/Layover/Layover/Workers/Mocks/MockPlaybackWorker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ final class MockPlaybackWorker: PlaybackWorkerProtocol {
}

func makeInfiniteScroll(posts: [Post]) -> [Post] {
guard let tempLastVideo: Post = posts.last,
let tempFirstVideo: Post = posts.first
else { return posts }
var tempVideos: [Post] = posts
var tempVideos: [Post] = []
for post in posts {
if post.board.videoURL != nil, post.board.status == .complete {
tempVideos.append(post)
}
}
guard let tempLastVideo: Post = tempVideos.last,
let tempFirstVideo: Post = tempVideos.first
else { return tempVideos }
tempVideos.insert(tempLastVideo, at: 0)
tempVideos.append(tempFirstVideo)
return tempVideos
Expand Down
Loading

0 comments on commit 166e756

Please sign in to comment.