-
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
Showing
7 changed files
with
108 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[tools] | ||
tuist = "4.20.0" | ||
tuist = "4.27.0" |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[tools] | ||
tuist = "4.25.0" | ||
tuist = "4.27.0" |
Large diffs are not rendered by default.
Oops, something went wrong.
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
130 changes: 65 additions & 65 deletions
130
OPeace/Projects/App/OpeaceTests/Sources/ProfileTest.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 |
---|---|---|
@@ -1,68 +1,68 @@ | ||
////// | ||
////// ProfileTest.swift | ||
////// OPeaceTests | ||
////// | ||
////// Created by 서원지 on 8/13/24. | ||
////// | ||
// | ||
//import Testing | ||
//import Presentation | ||
//import ComposableArchitecture | ||
//@testable import OPeace | ||
// ProfileTest.swift | ||
// OPeaceTests | ||
// | ||
//import XCTest | ||
//import UseCase | ||
//import Model | ||
//import Utills | ||
// Created by 서원지 on 8/13/24. | ||
// | ||
// | ||
//@MainActor | ||
//struct ProfileTest { | ||
// let store = TestStore(initialState: Profile.State()) { | ||
// Profile() | ||
// } withDependencies: { | ||
// let repository = AuthRepository() | ||
// $0.authUseCase = AuthUseCase(repository: repository) | ||
// } | ||
// | ||
// @Test("유저 정보 조회") | ||
// func testUserInfo_유저정보_조회() async throws { | ||
// var mockUpdateUserInfo = UpdateUserInfoModel.mockModel | ||
// | ||
// await store.send(.async(.fetchUserProfileResponse(.success(mockUpdateUserInfo)))) { state in | ||
// state.profileUserModel = mockUpdateUserInfo | ||
// } | ||
// | ||
// await store.send(.async(.fetchUser)) | ||
// | ||
// store.assert { state in | ||
// state.profileUserModel = mockUpdateUserInfo | ||
// } | ||
// | ||
// let mockError = CustomError.unknownError("Failed to fetch user info") | ||
// | ||
// | ||
// await store.send(.async(.fetchUserProfileResponse(.failure(mockError)))) { | ||
// XCTAssertNil($0.profileUserModel) | ||
// } | ||
// | ||
// | ||
// | ||
// await store.finish() | ||
// store.exhaustivity = .off | ||
// } | ||
// | ||
// @Test("유저 정보 업데이트") | ||
// func testUserInfo_유저정보_업데이트() async throws { | ||
// let testEditStore = TestStore(initialState: EditProfile.State()) { | ||
// EditProfile() | ||
// } withDependencies: { | ||
// let repository = AuthRepository() | ||
// $0.authUseCase = AuthUseCase(repository: repository) | ||
// let signupRepository = SingUpRepository() | ||
// $0.signUpUseCase = SignUpUseCase(repository: signupRepository) | ||
// } | ||
// | ||
// await testEditStore.send(.async(.updateUserInfo(nickName: "로이", year: 1998, job: "개발", generation: "Z 세대"))) | ||
// } | ||
//} | ||
|
||
import Testing | ||
import Presentation | ||
import ComposableArchitecture | ||
@testable import OPeace | ||
|
||
import XCTest | ||
import UseCase | ||
import Model | ||
import Utills | ||
|
||
|
||
@MainActor | ||
struct ProfileTest { | ||
let store = TestStore(initialState: Profile.State()) { | ||
Profile() | ||
} withDependencies: { | ||
let repository = AuthRepository() | ||
$0.authUseCase = AuthUseCase(repository: repository) | ||
} | ||
|
||
@Test("유저 정보 조회") | ||
func testUserInfo_유저정보_조회() async throws { | ||
var mockUpdateUserInfo = UpdateUserInfoModel.mockModel | ||
|
||
await store.send(.async(.fetchUserProfileResponse(.success(mockUpdateUserInfo)))) { state in | ||
state.profileUserModel = mockUpdateUserInfo | ||
} | ||
|
||
await store.send(.async(.fetchUser)) | ||
|
||
store.assert { state in | ||
state.profileUserModel = mockUpdateUserInfo | ||
} | ||
|
||
let mockError = CustomError.unknownError("Failed to fetch user info") | ||
|
||
|
||
await store.send(.async(.fetchUserProfileResponse(.failure(mockError)))) { | ||
XCTAssertNil($0.profileUserModel) | ||
} | ||
|
||
|
||
|
||
await store.finish() | ||
store.exhaustivity = .off | ||
} | ||
|
||
@Test("유저 정보 업데이트") | ||
func testUserInfo_유저정보_업데이트() async throws { | ||
let testEditStore = TestStore(initialState: EditProfile.State()) { | ||
EditProfile() | ||
} withDependencies: { | ||
let repository = AuthRepository() | ||
$0.authUseCase = AuthUseCase(repository: repository) | ||
let signupRepository = SingUpRepository() | ||
$0.signUpUseCase = SignUpUseCase(repository: signupRepository) | ||
} | ||
|
||
await testEditStore.send(.async(.updateUserInfo(nickName: "로이", year: 1998, job: "개발", generation: "Z 세대"))) | ||
} | ||
} |
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