From e961e8f7ed97fecb876a210300334bceb966a0df Mon Sep 17 00:00:00 2001 From: baegteun Date: Sat, 29 Jul 2023 22:31:08 +0900 Subject: [PATCH] =?UTF-8?q?:white=5Fcheck=5Fmark:=20::=20[#122]=20DetailNo?= =?UTF-8?q?ticeFeature=20/=20=EA=B3=B5=EC=A7=80=20=EC=84=A0=ED=83=9D=20?= =?UTF-8?q?=EB=B0=8F=20=ED=95=B4=EC=A0=9C=20=EC=95=A1=EC=85=98=20Tests?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Tests/NoticeFeatureTest.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Projects/Feature/NoticeFeature/Tests/NoticeFeatureTest.swift b/Projects/Feature/NoticeFeature/Tests/NoticeFeatureTest.swift index cc8ec71d..d8d2e16c 100644 --- a/Projects/Feature/NoticeFeature/Tests/NoticeFeatureTest.swift +++ b/Projects/Feature/NoticeFeature/Tests/NoticeFeatureTest.swift @@ -98,7 +98,7 @@ final class NoticeFeatureTests: XCTestCase { XCTAssertEqual(sut.currentState.isEditingMode, true) } - func test_RouteNoticeDetail_When_NoticeDidTap_And_IsEditingFalse() { + func test_RouteNoticeDetail_When_NoticeDidSelect_And_IsEditingFalse() { let expectedNoticeID = 1 XCTAssertEqual(sut.currentState.isEditingMode, false) let expectation = XCTestExpectation(description: "route expectation") @@ -110,12 +110,12 @@ final class NoticeFeatureTests: XCTestCase { } .store(in: &subscription) - sut.send(.noticeDidTap(expectedNoticeID)) + sut.send(.noticeDidSelect(expectedNoticeID)) wait(for: [expectation], timeout: 1.0) guard let latestRoutePath = latestRoutePath?.asDotori, - case let .noticeDetail(noticeID) = latestRoutePath, + case let .detailNotice(noticeID) = latestRoutePath, noticeID == expectedNoticeID else { XCTFail("latestRoutePath is not DotoriRoutePath.noticeDetail") @@ -123,25 +123,25 @@ final class NoticeFeatureTests: XCTestCase { } } - func test_InsertSelectedNotice_When_NoticeDidTap_And_IsEditingTrue() { + func test_InsertSelectedNotice_When_NoticeDidSelectAndDeselect_And_IsEditingTrue() { sut.send(.editButtonDidTap) XCTAssertEqual(sut.currentState.isEditingMode, true) let noticeIDOne = 1 - sut.send(.noticeDidTap(noticeIDOne)) + sut.send(.noticeDidSelect(noticeIDOne)) XCTAssertEqual([noticeIDOne], sut.currentState.selectedNotice) let noticeIDTwo = 2 - sut.send(.noticeDidTap(noticeIDTwo)) + sut.send(.noticeDidSelect(noticeIDTwo)) XCTAssertEqual([noticeIDOne, noticeIDTwo], sut.currentState.selectedNotice) - sut.send(.noticeDidTap(noticeIDOne)) - XCTAssertEqual([noticeIDTwo], sut.currentState.selectedNotice) - - sut.send(.noticeDidTap(noticeIDOne)) + sut.send(.noticeDidSelect(noticeIDOne)) XCTAssertEqual([noticeIDOne, noticeIDTwo], sut.currentState.selectedNotice) + sut.send(.noticeDidDeselect(noticeIDOne)) + XCTAssertEqual([noticeIDTwo], sut.currentState.selectedNotice) + sut.send(.editButtonDidTap) XCTAssertEqual([], sut.currentState.selectedNotice) }