102103104105106107108109110111112
@Test public void testMinWidthPassesMinWidthToCondition() { Condition condition = PassePartout.minWidth( PassePartout.px( 100 ) ); boolean complies = condition.compliesWith( new UIEnvironmentImpl( new Bounds( 10, 10, 110, 0 ), mock( Bounds.class ), 16 ) ); assertTrue( complies ); }
128129130131132133134135136137138
@Test public void testMaxWidthPassesMaxWidthToCondition() { Condition condition = PassePartout.maxWidth( PassePartout.px( 100 ) ); boolean complies = condition.compliesWith( new UIEnvironmentImpl( new Bounds( 10, 10, 90, 0 ), mock( Bounds.class ), 16 ) ); assertTrue( complies ); }
24252627282930
public static UIEnvironment createEnvironment() { return createEnvironment( new Bounds( 0, 0, 0, 0 ) ); } public static UIEnvironment createEnvironment( Bounds bounds ) { return new UIEnvironmentImpl( bounds, mock( Bounds.class ), 16 ); }