Background
views::get_platform_statistics (src/views.rs) returns a PlatformStatistics
struct with counters for total events, matches, predictions, participants, and
fees. There is no integration test that drives all of these counters through
multiple operations and asserts each field.
Goal
Add a comprehensive test in tests/views_tests.rs that exercises all counters.
Tasks
- Start: call
get_platform_statistics; assert all counters are 0.
- Create 2 events; assert
total_events == 2.
- Add 2 matches to each event (4 total); assert
total_matches == 4.
- Have 3 users join both events; submit predictions for each match; assert
- Assert
total_participants >= 3 (unique participants).
- Assert
total_fees_collected equals the sum of creation fees paid.
Acceptance Criteria
- Each counter matches the expected cumulative value after each operation.
Files
contracts/creator-event-manager/tests/views_tests.rs.
Background
views::get_platform_statistics(src/views.rs) returns aPlatformStatisticsstruct with counters for total events, matches, predictions, participants, and
fees. There is no integration test that drives all of these counters through
multiple operations and asserts each field.
Goal
Add a comprehensive test in
tests/views_tests.rsthat exercises all counters.Tasks
get_platform_statistics; assert all counters are 0.total_events == 2.total_matches == 4.total_participants >= 3(unique participants).total_fees_collectedequals the sum of creation fees paid.Acceptance Criteria
Files
contracts/creator-event-manager/tests/views_tests.rs.