Why this is useful
PositionsViewModel.sortedPositions has four sort modes (MarketValue, UnrealizedPnl, DailyPnl, Symbol) with no test coverage. A regression in sort order would silently ship.
Where to start
Create android/app/src/test/java/com/tis/ibkr/viewmodel/PositionsViewModelTest.kt. Construct a list of fake Position instances with varied PnL and market values, set the sort mode, assert order.
Definition of done
- One test per sort mode (4 tests).
- All pass under
./gradlew test.
- No new dependencies (use the existing JUnit on the test classpath).
Why this is useful
PositionsViewModel.sortedPositionshas four sort modes (MarketValue,UnrealizedPnl,DailyPnl,Symbol) with no test coverage. A regression in sort order would silently ship.Where to start
Create
android/app/src/test/java/com/tis/ibkr/viewmodel/PositionsViewModelTest.kt. Construct a list of fakePositioninstances with varied PnL and market values, set the sort mode, assert order.Definition of done
./gradlew test.