Skip to content

Commit

Permalink
Make testDendrogramPanelScaleBarSmallerOne independent of operating s…
Browse files Browse the repository at this point in the history
…ystem
  • Loading branch information
stefanhahmann committed Nov 6, 2023
1 parent 2f7a588 commit beabfbd
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ public void testDendrogramPanelScaleBarSmallerOne()
DendrogramPanel< String > dendrogramPanel = new DendrogramPanel<>( classification );
DendrogramPanel< String >.ScaleBar scalebar =
dendrogramPanel.new ScaleBar( dendrogramPanel.new DisplayMetrics( 507, 426, graphics ) );
Set< String > expectedTickValues = new HashSet<>( Arrays.asList( "0,0", "0,1", "0,2", "0,3", "0,4", "0,5", "0,6", "0,7" ) );
Set< Double > expectedTickValuesDouble = new HashSet<>( Arrays.asList( 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7 ) );
Set< String > expectedTickValues =
expectedTickValuesDouble.stream().map( d -> String.format( "%.1f", d ) ).collect( Collectors.toSet() );
Set< String > actualTickValues = scalebar.ticks.stream().map( Pair::getValue ).collect( Collectors.toSet() );
assertEquals( 8, scalebar.ticks.size() );
assertEquals( expectedTickValues, actualTickValues );
Expand Down

0 comments on commit beabfbd

Please sign in to comment.