Package limelight.model.events

Source Code of limelight.model.events.ProductionEventTest

//- Copyright © 2008-2011 8th Light, Inc. All Rights Reserved.
//- Limelight and all included source files are distributed under terms of the MIT License.

package limelight.model.events;

import limelight.model.FakeProduction;
import limelight.ui.model.inputs.MockEventAction;
import org.junit.Before;
import org.junit.Test;

import static junit.framework.Assert.assertEquals;

public class ProductionEventTest
{
  private FakeProduction production;
  private TestableProductionEvent event;
  private MockEventAction action;

  public static class TestableProductionEvent extends ProductionEvent
  {
  }

  @Before
  public void setUp() throws Exception
  {
    production = new FakeProduction();
    event = new TestableProductionEvent();
    action = new MockEventAction();
  }

  @Test
  public void dispatching() throws Exception
  {
    production.getEventHandler().add(TestableProductionEvent.class, action);

    event.dispatch(production);

    assertEquals(true, action.invoked);
    assertEquals(production, event.getSubject());
    assertEquals(production, event.getProduction());
  }
}
TOP

Related Classes of limelight.model.events.ProductionEventTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.