-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor tests #251
Refactor tests #251
Conversation
- Added comprehensive tests for `toMarket` and `toRemoteMarketDto` mappers, covering valid, empty, extreme, and negative value scenarios. - Updated `kotest` to version `6.0.0.M1`.
- Implement detailed test cases in `MarketEntityMapperTest` to cover various scenarios. - Add test cases for empty strings, zero values, extreme double values, and negative values. - Add test cases for handling `isFavorite` as both true and false. - Improve the equality checks in the tests. - Refactor existing test cases to use shouldBe instead of shouldBeEqual. - remove unnecessary imports.
|
||
val market = marketResponse.toMarket() | ||
|
||
market shouldBeEqual marketResponse |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
market shouldBeEqual marketResponse | |
MarketResponse( | |
id = "extreme", | |
name = "Extreme Market", | |
symbol = "ext", | |
currentPrice = Double.MAX_VALUE, | |
priceChangePercentage24h = Double.MIN_VALUE, | |
imageUrl = "https://image.url/extreme.png", | |
).toMarket() shouldBeEqual marketResponse |
|
||
val market = marketEntity.toMarket() | ||
|
||
market shouldBeEqual marketEntity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
market shouldBeEqual marketEntity | |
MarketEntity( | |
id = "bitcoin", | |
name = "Bitcoin", | |
symbol = "btc", | |
currentPrice = 20000.0, | |
priceChangePercentage24h = 2.0, | |
imageUrl = "https://image.url/bitcoin.png", | |
isFavorite = FALSE, | |
).toMarket() shouldBeEqual marketEntity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add unnecessary variables as much as possible.
I commented on some of those, we should fix all of them
Refactor existing tests in
data:market-repository
module.close #250