Skip to content

Add unit tests for PositionsViewModel.sortedPositions #2

Description

@whtis

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions