-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
16ba657
commit 553d572
Showing
5 changed files
with
39 additions
and
4 deletions.
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
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
28 changes: 28 additions & 0 deletions
28
Projects/Services/DataModule/Sources/Students/UseCases/Fake/SignupUseCaseFake.swift
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,28 @@ | ||
import Combine | ||
import DataMappingModule | ||
import DomainModule | ||
import ErrorModule | ||
import Foundation | ||
|
||
public struct SignupUseCaseFake: SignupUseCase { | ||
public init () {} | ||
|
||
public func execute(req: SignupRequestDTO) -> AnyPublisher<DmsFeatures, DmsError> { | ||
if req.accountID == "baekteun" && req.password == "baekteun" { | ||
return Just(DmsFeatures( | ||
mealService: true, | ||
noticeService: true, | ||
pointService: true, | ||
studyRoomService: false, | ||
remainService: false | ||
)) | ||
.setFailureType(to: DmsError.self) | ||
.delay(for: 1, scheduler: DispatchQueue.main) | ||
.eraseToAnyPublisher() | ||
} else { | ||
return Fail(error: DmsError.passwordMismatch) | ||
.delay(for: 1, scheduler: DispatchQueue.main) | ||
.eraseToAnyPublisher() | ||
} | ||
} | ||
} |