Class StatusListTest

java.lang.Object
com.example.breeze_seas.StatusListTest

public class StatusListTest extends Object
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 Details

    • StatusListTest

      public StatusListTest()
  • Method Details

    • setup

      public void setup() throws InterruptedException
      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

      public void appearsOnWaitingList() throws InterruptedException
      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

      public void testWaitingListCapacity() throws InterruptedException
      Tests the enforcement of the waiting list capacity limit.
      Throws:
      InterruptedException - if synchronization latches time out.
    • testFullLotteryFlow

      public void testFullLotteryFlow() throws InterruptedException
      Executes an end-to-end test of the event lottery system.
      Throws:
      InterruptedException - if the lottery processing delay is interrupted.
    • cleanup

      public void cleanup() throws InterruptedException
      Final cleanup after each test to ensure no documents remain in the remote Firestore environment.
      Throws:
      InterruptedException - if the cleanup latch fails.