Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] handling null or invalid market detail response #254
This commit introduces a new test suite `MarketDetailDtoMapperKtTest` to specifically address scenarios where the market detail response might contain null or invalid data. **Key changes:** * Added test cases to handle `null` values for `id`, `name`, and `marketCapRank` in the `MarketDetailResponse`. * Added test cases to handle `null` `marketData` within `MarketDetailResponse`. * Added test cases to handle `null` fields within `marketData` like `high24h`, `low24h`, `marketCap`, and `marketCapRank`. * Added test cases for handling negative and zero values in market data. * Refactored test assertions to compare against expected default values when `null` is present. * Implemented custom `shouldBeEqual` functions for more readable assertions. * These test cases ensure the robustness of the mapping logic, especially when dealing with incomplete or faulty external data. * The new test cases verify that default values are assigned properly when data is null. * The new test cases verify that zero values and negative values are handled properly. * The test cases ensures the response will be associated with the request.
- Loading branch information