Conversation
Contributor
There was a problem hiding this comment.
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. |
Projects/Domain/Testing/AllMarketTicker/StubAllMaketTickerRepository.swift
Show resolved
Hide resolved
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
변경된 점
Domain모듈 단위 테스트코드 작성
실제 웹소켓 스트림을 사용하지 않고 테스트 더블즈 객체를 Testing모듈에 구현하여 단위 테스트를 진행했습니다.
※ UseCase마다 필요한 StubRepository객체를 생성하였습니다.
DefaultAllMarketTickerUseCase테스트 목록
DefaultCoinDetailPageUseCase테스트 목록
※ 테스트 코드 작성 프레임워크로는
Testing을 사용했습니다.