Search in sources :

Example 1 with StageDeactivatedEvent

use of limelight.ui.events.stage.StageDeactivatedEvent in project limelight by slagyr.

the class TheaterTest method knowsWhenStagesAreDeactivated.

@Test
public void knowsWhenStagesAreDeactivated() throws Exception {
    MockStage stage2 = new MockStage("two");
    theater.add(defaultStage);
    theater.add(stage2);
    new StageActivatedEvent().dispatch(defaultStage);
    new StageDeactivatedEvent().dispatch(defaultStage);
    assertEquals(null, theater.getActiveStage());
}
Also used : StageDeactivatedEvent(limelight.ui.events.stage.StageDeactivatedEvent) MockStage(limelight.ui.model.MockStage) StageActivatedEvent(limelight.ui.events.stage.StageActivatedEvent) Test(org.junit.Test)

Example 2 with StageDeactivatedEvent

use of limelight.ui.events.stage.StageDeactivatedEvent in project limelight by slagyr.

the class TheaterTest method attemptsToCloseProductionWhenAllStagesAreHidden.

@Test
public void attemptsToCloseProductionWhenAllStagesAreHidden() throws Exception {
    MockStage stage2 = new MockStage("two");
    defaultStage.setVital(false);
    stage2.setVital(false);
    theater.add(defaultStage);
    theater.add(stage2);
    defaultStage.setVisible(false);
    stage2.setVisible(false);
    new StageDeactivatedEvent().dispatch(defaultStage);
    new StageDeactivatedEvent().dispatch(stage2);
    assertEquals(true, production.closeAttempted);
}
Also used : StageDeactivatedEvent(limelight.ui.events.stage.StageDeactivatedEvent) MockStage(limelight.ui.model.MockStage) Test(org.junit.Test)

Example 3 with StageDeactivatedEvent

use of limelight.ui.events.stage.StageDeactivatedEvent in project limelight by slagyr.

the class TheaterTest method doesntAttemptsToCloseProductionWhenAllStagesAreHiddenButStillHasVitalStage.

@Test
public void doesntAttemptsToCloseProductionWhenAllStagesAreHiddenButStillHasVitalStage() throws Exception {
    MockStage stage2 = new MockStage("two");
    defaultStage.setVital(false);
    stage2.setVital(true);
    theater.add(defaultStage);
    theater.add(stage2);
    defaultStage.setVisible(false);
    stage2.setVisible(false);
    new StageDeactivatedEvent().dispatch(defaultStage);
    new StageDeactivatedEvent().dispatch(stage2);
    assertEquals(false, production.closeAttempted);
}
Also used : StageDeactivatedEvent(limelight.ui.events.stage.StageDeactivatedEvent) MockStage(limelight.ui.model.MockStage) Test(org.junit.Test)

Aggregations

StageDeactivatedEvent (limelight.ui.events.stage.StageDeactivatedEvent)3 MockStage (limelight.ui.model.MockStage)3 Test (org.junit.Test)3 StageActivatedEvent (limelight.ui.events.stage.StageActivatedEvent)1