Skip to content

[CVW-042] Domain모듈 단위 테스트코드 작성#54

Merged
J0onYEong merged 3 commits intomainfrom
feature/DomainTests
Apr 24, 2025
Merged

[CVW-042] Domain모듈 단위 테스트코드 작성#54
J0onYEong merged 3 commits intomainfrom
feature/DomainTests

Conversation

@J0onYEong
Copy link
Collaborator

변경된 점

  • Domain모듈 단위 테스트코드 작성

Domain모듈 단위 테스트코드 작성

실제 웹소켓 스트림을 사용하지 않고 테스트 더블즈 객체를 Testing모듈에 구현하여 단위 테스트를 진행했습니다.
※ UseCase마다 필요한 StubRepository객체를 생성하였습니다.

DefaultAllMarketTickerUseCase테스트 목록

📋 테스트 진행 목록
반환되는 코인정들의 Suffix심볼(Second symbol)이 USDT인지 확인
전체 리스트에서 totalTradedQuoteAssetVolume를 기준으로 내림차순 정렬이 잘 적용되는지 확인

DefaultCoinDetailPageUseCase테스트 목록

📋 테스트 진행 목록
매수, 매도 호가창 리스트가 비즈니스 로직에 따라 올바르게 정렬되어 반환되는지 확인

※ 테스트 코드 작성 프레임워크로는 Testing을 사용했습니다.

@J0onYEong J0onYEong requested a review from Copilot April 24, 2025 10:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces unit tests for domain use cases related to coin details and market tickers, ensuring that data sorting and symbol formatting work as expected without relying on live websocket streams. Key changes include:

  • Addition of test files for DefaultCoinDetailPageUseCase and DefaultAllMarketTickersUseCase using Testing framework.
  • Modifications to dependency injection in the Assemblies and DomainAssembly files to provide resolved dependencies.
  • Introduction of several stub repositories to support unit testing without external dependencies.

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Projects/Features/CoinDetail/Example/Sources/DI/Assemblies.swift Updated DI registration for CoinDetailPageUseCase to use resolved dependencies.
Projects/Domain/Tests/CoinDetailPageUseCaseTests.swift New unit tests for verifying bid/ask order sorting in CoinDetailPageUseCase.
Projects/Domain/Tests/AllMarketTickerTests.swift New unit tests to validate ticker symbol suffix and sorted order based on traded volume.
Projects/Domain/Testing/... New stub repository files for SingleMarketTicker, Orderbook, CoinTrade, UserConfiguration, ExchangeRate, and AllMarketTicker use cases.
Projects/Domain/Interface/Entity/Orderbook/... Minor improvements including added typealiases and Equatable conformance.
Projects/Domain/Concrete/UseCase/... Adjustments to use explicit dependency injection for use cases.
Projects/App/Sources/DI/Assembly/DomainAssembly.swift Updated DI registration for domain use cases to ensure dependencies are correctly resolved.

@J0onYEong J0onYEong merged commit 2a47419 into main Apr 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants