Package com.example.breeze_seas
Class StatusListTest
java.lang.Object
com.example.breeze_seas.StatusListTest
Integrated tests for the StatusList and Lottery functionality.
This class validates the interaction between the UI (Fragments), the ViewModels,
and the Firebase Firestore backend, focusing on participant list
management and the randomized lottery draw.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidVerifies that a user added to the waiting list appears correctly in the UI.voidcleanup()Final cleanup after each test to ensure no documents remain in the remote Firestore environment.voidsetup()Initializes the test environment before each test case.voidExecutes an end-to-end test of the event lottery system.voidTests the enforcement of the waiting list capacity limit.
-
Constructor Details
-
StatusListTest
public StatusListTest()
-
-
Method Details
-
setup
Initializes the test environment before each test case. Performs anonymous Firebase authentication and resets the Firestore database to a clean state. It also creates a base event document required for participant sub-collections.- Throws:
InterruptedException- if the synchronization latches are interrupted.
-
appearsOnWaitingList
Verifies that a user added to the waiting list appears correctly in the UI. Checks both the existence of the data object in the adapter and the formatted text in the ListView row.- Throws:
InterruptedException- if the Firestore write or UI sync times out.
-
testWaitingListCapacity
Tests the enforcement of the waiting list capacity limit.- Throws:
InterruptedException- if synchronization latches time out.
-
testFullLotteryFlow
Executes an end-to-end test of the event lottery system.- Throws:
InterruptedException- if the lottery processing delay is interrupted.
-
cleanup
Final cleanup after each test to ensure no documents remain in the remote Firestore environment.- Throws:
InterruptedException- if the cleanup latch fails.
-