Skip to content
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

Test: Add unit tests for TimeTableViewModel #515

Merged
merged 1 commit into from
Jan 8, 2025

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Jan 6, 2025

TL;DR

Enhanced the trip planning test infrastructure with improved fake builders and added comprehensive tests for journey caching.

What changed?

  • Created a builder pattern for FakeTripResponseBuilder with configurable parameters
  • Added support for generating multiple journeys with realistic time sequences
  • Implemented tests for journey caching behavior in TimeTableViewModel
  • Added visibility annotations for testing internal components
  • Enhanced logging for journey time debugging

How to test?

  1. Run the TimeTableViewModelTest suite
  2. Verify the new journey caching tests:
    • Test for basic journey updates
    • Test for started journey threshold handling
    • Test for journey sorting behavior
  3. Validate the fake builder functionality with different journey configurations

Why make this change?

To improve test coverage and maintainability of the trip planning feature, particularly around journey caching logic. The enhanced fake builders provide more realistic test scenarios and make it easier to test complex journey combinations.

@ksharma-xyz ksharma-xyz changed the title Test: Add unit tests for TripResponseBuilder and TimeTableViewModel Test: Add unit tests for TimeTableViewModel Jan 6, 2025
@ksharma-xyz ksharma-xyz marked this pull request as ready for review January 6, 2025 06:35
@ksharma-xyz ksharma-xyz added this to the 1.0.5 milestone Jan 6, 2025
@ksharma-xyz ksharma-xyz force-pushed the 01-05-add_ut_for_loadtimetable branch from e08db01 to 0be602a Compare January 6, 2025 06:38
@ksharma-xyz ksharma-xyz force-pushed the 01-06-test_for_updatetripscache branch from 948c698 to 8ad4763 Compare January 6, 2025 06:38
@ksharma-xyz ksharma-xyz force-pushed the 01-05-add_ut_for_loadtimetable branch from 0be602a to eee5afd Compare January 6, 2025 13:12
@ksharma-xyz ksharma-xyz force-pushed the 01-06-test_for_updatetripscache branch from 8ad4763 to 5307515 Compare January 6, 2025 13:13
@ksharma-xyz ksharma-xyz force-pushed the 01-05-add_ut_for_loadtimetable branch from eee5afd to 77d8448 Compare January 8, 2025 00:37
@ksharma-xyz ksharma-xyz force-pushed the 01-06-test_for_updatetripscache branch from 5307515 to a61f184 Compare January 8, 2025 00:37
@ksharma-xyz ksharma-xyz changed the base branch from 01-05-add_ut_for_loadtimetable to graphite-base/515 January 8, 2025 00:59
@ksharma-xyz ksharma-xyz force-pushed the 01-06-test_for_updatetripscache branch from a61f184 to ae779c7 Compare January 8, 2025 00:59
@ksharma-xyz ksharma-xyz changed the base branch from graphite-base/515 to main January 8, 2025 01:00
Copy link
Owner Author

ksharma-xyz commented Jan 8, 2025

Merge activity

  • Jan 8, 2:39 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Jan 8, 2:40 AM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz merged commit 571f489 into main Jan 8, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

1 participant