Skip to content

Commit

Permalink
feature: 화이트보드 오브젝트 관리 테스트 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
taipaise committed Nov 16, 2024
1 parent cfbc91f commit 3651910
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Domain/DomainTests/ManageWhiteboardObjectsUseCaseTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,27 @@ final class ManageWhiteboardObjectsUseCaseTests: XCTestCase {
XCTAssertEqual(updatedObject, receivedObject)
}

// 존재하지 않는 화이트보드 오브젝트 업데이트 실패하는지 테스트
func testUpdateNonExistentObject() {
// 준비
let targetObject = WhiteboardObject(
id: UUID(),
position: CGPoint(x: 50, y: 50),
size: CGSize(width: 200, height: 200))
var receivedObject: WhiteboardObject?

useCase.updatedObjectPublisher
.sink { receivedObject = $0 }
.store(in: &cancellables)

// 실행
let result = useCase.updateObject(whiteboardObject: targetObject)

// 검증
XCTAssertFalse(result)
XCTAssertNil(receivedObject)
}

// 화이트보드 오브젝트 삭제 성공하는지 테스트
func testRemoveObject() {
// 준비
Expand Down

0 comments on commit 3651910

Please sign in to comment.