Skip to content

Commit

Permalink
🔧 코드 리뷰 반영 불필요 파일 삭제, 엣지 케이스 반영
Browse files Browse the repository at this point in the history
  • Loading branch information
loinsir committed Dec 13, 2023
1 parent 3893280 commit 859795c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 89 deletions.
4 changes: 0 additions & 4 deletions iOS/Layover/Layover.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
19AE48182B28C2B700DD4612 /* SettingInteractorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AE48142B28C2B700DD4612 /* SettingInteractorTests.swift */; };
19AE481A2B28C2B700DD4612 /* SettingPresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AE48162B28C2B700DD4612 /* SettingPresenterTests.swift */; };
19AE481C2B28C53800DD4612 /* MockSettingWorker.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AE481B2B28C53800DD4612 /* MockSettingWorker.swift */; };
19AE48222B29D03D00DD4612 /* EditProfileViewControllerTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AE481E2B29D03D00DD4612 /* EditProfileViewControllerTests.swift */; };
19AE48232B29D03D00DD4612 /* EditProfileInteractorTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AE481F2B29D03D00DD4612 /* EditProfileInteractorTests.swift */; };
19AE48252B29D03D00DD4612 /* EditProfilePresenterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19AE48212B29D03D00DD4612 /* EditProfilePresenterTests.swift */; };
19C7AFCE2B02410F003B35F2 /* AuthManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19C7AFCD2B02410F003B35F2 /* AuthManager.swift */; };
Expand Down Expand Up @@ -351,7 +350,6 @@
19AE48142B28C2B700DD4612 /* SettingInteractorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingInteractorTests.swift; sourceTree = "<group>"; };
19AE48162B28C2B700DD4612 /* SettingPresenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingPresenterTests.swift; sourceTree = "<group>"; };
19AE481B2B28C53800DD4612 /* MockSettingWorker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MockSettingWorker.swift; sourceTree = "<group>"; };
19AE481E2B29D03D00DD4612 /* EditProfileViewControllerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditProfileViewControllerTests.swift; sourceTree = "<group>"; };
19AE481F2B29D03D00DD4612 /* EditProfileInteractorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditProfileInteractorTests.swift; sourceTree = "<group>"; };
19AE48212B29D03D00DD4612 /* EditProfilePresenterTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EditProfilePresenterTests.swift; sourceTree = "<group>"; };
19C7AFCD2B02410F003B35F2 /* AuthManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthManager.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -750,7 +748,6 @@
19AE481D2B29D02700DD4612 /* EditProfile */ = {
isa = PBXGroup;
children = (
19AE481E2B29D03D00DD4612 /* EditProfileViewControllerTests.swift */,
19AE481F2B29D03D00DD4612 /* EditProfileInteractorTests.swift */,
19AE48212B29D03D00DD4612 /* EditProfilePresenterTests.swift */,
);
Expand Down Expand Up @@ -1523,7 +1520,6 @@
19AE48172B28C2B700DD4612 /* SettingViewControllerTests.swift in Sources */,
194C21C32B1DEE6B00C62645 /* HomeViewControllerTests.swift in Sources */,
192513692B26F7CE001533FA /* TagPlayListInteractorTests.swift in Sources */,
19AE48222B29D03D00DD4612 /* EditProfileViewControllerTests.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 @@ -76,6 +76,12 @@ final class EditProfileInteractorTests: XCTestCase {
}
}

final class UserWorkerMock: UserWorker {
override func checkNotDuplication(for userName: String) async -> Bool? {
return false
}
}

// MARK: - Tests

func test_setProfile을_실행하면_presenter의_presentProfile이_호출되고_자신의_데이터를_presenter에게_전달한다() {
Expand Down Expand Up @@ -281,7 +287,6 @@ final class EditProfileInteractorTests: XCTestCase {
}

func test_checkDuplication을_실행했을때_중복된_닉네임이_아니라면_presenter의_presentNicknameDuplication을_호출하고_올바른_값을_전달한다() async {

// arrange
let spy = EditProfilePresentationLogicSpy()
sut.presenter = spy
Expand All @@ -298,5 +303,23 @@ final class EditProfileInteractorTests: XCTestCase {
"checkDuplication을 호출해서 presenter에게 올바른 canEditProfile값을 전달하지 못했다.")
}

func test_checkDuplication을_실행했을때_중복된_닉네임이라면_presenter의_presentNicknameDuplication을_호출하고_올바른_값을_전달한다() async {

// arrange
let spy = EditProfilePresentationLogicSpy()
sut.presenter = spy
sut.userWorker = UserWorkerMock()

// act
await sut.checkDuplication(with: Models.CheckNicknameDuplication.Request(nickname: "안유진"))

// assert
XCTAssertTrue(spy.presentNicknameDuplicationCalled, "checkDuplication을 호출해서 presenter의 presentNicknameDuplication을 호출하지 못했다.")
XCTAssertFalse(spy.presentNicknameDuplicationResponse.isValid,
"checkDuplication을 호출해서 presenter에게 올바른 isValid값을 전달하지 못했다.")

XCTAssertFalse(spy.presentNicknameDuplicationResponse.canEditProfile,
"checkDuplication을 호출해서 presenter에게 올바른 canEditProfile값을 전달하지 못했다.")}

// TODO: editProfile 테스트 메서드는 내부 병렬실행 이슈 해결 후 작성
}

This file was deleted.

0 comments on commit 859795c

Please sign in to comment.