Examples of AlwaysTrueContidtion


Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  }

  @Test
  public void testCompliesWithQuery() {
    QueryVerifier verifier = new QueryVerifier( createEnvironment() );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );

    boolean complies = verifier.complies( query );

    assertTrue( complies );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  @Test
  public void testCompliesNotWithOneFalseConditions() {
    QueryVerifier verifier = new QueryVerifier( createEnvironment() );
    Condition condition = mock( Condition.class );
    doReturn( Boolean.FALSE ).when( condition ).compliesWith( any( UIEnvironment.class ) );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );

    boolean complies = verifier.complies( query.and( condition ) );

    assertFalse( complies );
  }
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  @Test
  public void testCompliesWithRule() {
    Rule rule = mock( Rule.class );
    QueryVerifier verifier = new QueryVerifier( createEnvironment() );
    List<Condition> conditions = new ArrayList<Condition>();
    conditions.add( new AlwaysTrueContidtion() );
    when( rule.getConditions() ).thenReturn( conditions );

    boolean complies = verifier.complies( rule );

    assertTrue( complies );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

    Rule rule = mock( Rule.class );
    QueryVerifier verifier = new QueryVerifier( createEnvironment() );
    Condition condition = mock( Condition.class );
    doReturn( Boolean.FALSE ).when( condition ).compliesWith( any( UIEnvironment.class ) );
    List<Condition> conditions = new ArrayList<Condition>();
    conditions.add( new AlwaysTrueContidtion() );
    conditions.add( condition );
    when( rule.getConditions() ).thenReturn( conditions );

    boolean complies = verifier.complies( rule );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  @Test
  public void testNotifiesListenerActivated() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );
    notifier.addQueryListener( query, listener );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 0, 0 ) ) );

    verify( listener ).activated( query );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  @Test
  public void testNotifiesMultipleValidListenerActivated() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryListener listener2 = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );
    Query query2 = new QueryImpl( new AlwaysTrueContidtion() ).and( new MaxWidthCondition( px( 99 ) ) );
    notifier.addQueryListener( query, listener );
    notifier.addQueryListener( query2, listener2 );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 90, 0 ) ) );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  @Test
  public void testNotifiesListenerActivatedOnce() {
    QueryNotifier notifier = new QueryNotifier();
    QueryListener listener = mock( QueryListener.class );
    QueryImpl query = new QueryImpl( new AlwaysTrueContidtion() );
    notifier.addQueryListener( query, listener );

    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 0, 0 ) ) );
    notifier.notifyListeners( createEnvironment( new Bounds( 0, 0, 0, 0 ) ) );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  }

  @Test
  public void testAppliesFont() {
    Font font = FontDescriptor.createFrom( shell.getDisplay().getSystemFont() ).setHeight( 44 ).createFont( shell.getDisplay() );
    Rule rule = PassePartout.when( new AlwaysTrueContidtion() ).then( new FontInstruction( font ) );
    ResourceImpl resource = new ResourceImpl( rule );

    resource.bindTo( shell );

    assertEquals( font, shell.getFont() );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  }

  @Test
  public void testAppliesForeground() {
    Color color = shell.getDisplay().getSystemColor( SWT.COLOR_BLUE );
    Rule rule = PassePartout.when( new AlwaysTrueContidtion() ).then( new ForegroundInstruction( color ) );
    ResourceImpl resource = new ResourceImpl( rule );

    resource.bindTo( shell );

    assertEquals( color, shell.getForeground() );
View Full Code Here

Examples of com.eclipsesource.tabris.passepartout.internal.condition.AlwaysTrueContidtion

  }

  @Test
  public void testAppliesBackground() {
    Color color = shell.getDisplay().getSystemColor( SWT.COLOR_BLUE );
    Rule rule = PassePartout.when( new AlwaysTrueContidtion() ).then( new BackgroundInstruction( color ) );
    ResourceImpl resource = new ResourceImpl( rule );

    resource.bindTo( shell );

    assertEquals( color, shell.getBackground() );
View Full Code Here
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.