Skip to content

Commit

Permalink
fix: 테스트 코드 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
taipaise committed Dec 1, 2024
1 parent 991513f commit a328752
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Domain/DomainTests/AddPhotoUseCaseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class MockPhotoRepository: PhotoRepositoryInterface {
func fetchPhoto(id: UUID) -> Data? {
return Data()
}

func savePhoto(id: UUID, imageData: Data) -> URL? {
return URL(filePath: "photo.jpg")
}
Expand Down
39 changes: 35 additions & 4 deletions Domain/DomainTests/ManageWhiteboardObjectsUseCaseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ final class ManageWhiteboardObjectsUseCaseTests: XCTestCase {

useCase = ManageWhiteboardObjectUseCase(
profileRepository: profileRepository,
whiteboardRepository: MockWhiteObjectRepository(),
whiteboardObjectRepository: MockWhiteObjectRepository(),
whiteboardRepository: MockWhiteboardRepository(),
whiteboardObjectSet: WhiteboardObjectSet())
cancellables = []
}
Expand Down Expand Up @@ -434,9 +435,39 @@ final class MockProfileRepository: ProfileRepositoryInterface {
}

final class MockWhiteObjectRepository: WhiteboardObjectRepositoryInterface {
var delegate: (any Domain.WhiteboardObjectRepositoryDelegate)?
var delegate: (any WhiteboardObjectRepositoryDelegate)?

func send(whiteboardObject: Domain.WhiteboardObject, isDeleted: Bool) async {
return
func send(
whiteboardObject: WhiteboardObject,
isDeleted: Bool,
to profile: Profile
) async {}

func send(
whiteboardObjects: [WhiteboardObject],
isDeleted: Bool,
to profile: Profile
) async {}

func send(whiteboardObject: WhiteboardObject, isDeleted: Bool) async {}
}

final class MockWhiteboardRepository: WhiteboardRepositoryInterface {
var delegate: (any WhiteboardRepositoryDelegate)?
var recentPeerPublisher: AnyPublisher<Domain.Profile, Never>
private var recentPeerSubject = PassthroughSubject<Domain.Profile, Never>()

init() {
recentPeerPublisher = recentPeerSubject.eraseToAnyPublisher()
}

func startPublishing(myProfile: Profile) {}

func stopSearching() {}

func startSearching() {}

func disconnectWhiteboard() {}

func joinWhiteboard(whiteboard: Domain.Whiteboard, myProfile: Domain.Profile) throws {}
}

0 comments on commit a328752

Please sign in to comment.