Package limelight.builtin.players

Source Code of limelight.builtin.players.TextBoxTest

package limelight.builtin.players;

import limelight.model.api.FakePropProxy;
import limelight.ui.events.panel.CastEvent;
import limelight.ui.model.FakeScene;
import limelight.ui.model.PropPanel;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;

public class TextBoxTest
{
  public TextBox textBox;
  public PropPanel propPanel;

  @Before
  public void setUp() throws Exception
  {
    textBox = new TextBox();
    propPanel = new PropPanel(new FakePropProxy());
    new FakeScene().add(propPanel);
    textBox.install(new CastEvent(propPanel));
  }

  @Test
  public void installation() throws Exception
  {
    assertEquals(propPanel, textBox.getPropPanel());
    assertNotNull(textBox.getTextBoxPanel());
    assertEquals(textBox.getTextBoxPanel(), propPanel.getChildren().get(0));
    assertEquals(true, propPanel.isSterilized());
    assertNotNull(propPanel.getBackstage().get("text-box"));
    assertEquals(TextBox.class, propPanel.getBackstage().get("text-box").getClass());
  }

  @Test
  public void passwordMode() throws Exception
  {
    assertEquals(false, textBox.isPassword());

    textBox.setPassword(true);

    assertEquals(true, textBox.isPassword());
  }
}
TOP

Related Classes of limelight.builtin.players.TextBoxTest

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.