Package com.eclipsesource.tabris.passepartout.internal

Examples of com.eclipsesource.tabris.passepartout.internal.UIEnvironmentImpl


  @Test
  public void testCompliesWithWidthSmallerThanMaxWidthEm() {
    MaxWidthCondition condition = new MaxWidthCondition( new Em( BigDecimal.TEN ) );
    Bounds bounds = new Bounds( 10, 10, 90, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, new Bounds( 0, 0, 0, 0 ), 16 ) );

    assertTrue( complies );
  }
View Full Code Here


  @Test
  public void testCompliesNotWithWidthBiggerThanMaxWidthEm() {
    MaxWidthCondition condition = new MaxWidthCondition( new Em( BigDecimal.valueOf( 100 ) ) );
    Bounds bounds = new Bounds( 10, 10, 90, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, new Bounds( 0, 0, 0, 0 ), 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  public void testCompliesWithWidthSmallerThanMaxWidthPercentage() {
    MaxWidthCondition condition = new MaxWidthCondition( new Percentage( BigDecimal.valueOf( 50 ) ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 200, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  public void testCompliesNotWithWidthBiggerThanMaxWidthPercentage() {
    MaxWidthCondition condition = new MaxWidthCondition( new Percentage( BigDecimal.valueOf( 40 ) ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 200, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertFalse( complies );
  }
View Full Code Here

  @Test
  public void testCompliesWithWidthBiggerThanMinWidthInEm() {
    MinWidthCondition condition = new MinWidthCondition( new Em( BigDecimal.valueOf( 3 ) ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, mock( Bounds.class ), 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  @Test
  public void testCompliesWithWidthSameThanMinWidthInEm() {
    MinWidthCondition condition = new MinWidthCondition( new Em( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 160, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, mock( Bounds.class ), 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  @Test
  public void testCompliesNotWithWidthSmallerThanMinWidthInEm() {
    MinWidthCondition condition = new MinWidthCondition( new Em( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, mock( Bounds.class ), 16 ) );

    assertFalse( complies );
  }
View Full Code Here

  public void testCompliesWithWidthBiggerThanMinWidthInPercentage() {
    MinWidthCondition condition = new MinWidthCondition( new Percentage( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 11, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  public void testCompliesWithWidthSameThanMinWidthInPercentage() {
    MinWidthCondition condition = new MinWidthCondition( new Percentage( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 10, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertTrue( complies );
  }
View Full Code Here

  public void testCompliesNotWithWidthSmallerThanMinWidthInPercentage() {
    MinWidthCondition condition = new MinWidthCondition( new Percentage( BigDecimal.valueOf( 10 ) ) );
    Bounds bounds = new Bounds( 10, 10, 9, 0 );
    Bounds referenceBounds = new Bounds( 10, 10, 100, 0 );

    boolean complies = condition.compliesWith( new UIEnvironmentImpl( bounds, referenceBounds, 16 ) );

    assertFalse( complies );
  }
View Full Code Here

TOP

Related Classes of com.eclipsesource.tabris.passepartout.internal.UIEnvironmentImpl

Copyright © 2018 www.massapicom. 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.