Beispiel #1
0
  @SmallTest
  public void testShouldNotScaleSquareToMaxSquare() {

    Point point = tested.scaleToFitCalc(96, new Point(128, 128));

    assertThat(point).isEqualTo(POINT_96_96);
  }
Beispiel #2
0
  @SmallTest
  public void testShouldNotScaleForEqualToSize() {

    Point point = tested.scaleToFitCalc(96, POINT_96_96);

    assertThat(point).isEqualTo(POINT_96_96);
  }
Beispiel #3
0
  @SmallTest
  public void testShouldScaleWithCorrectAspectRatio() {

    Point point = tested.scaleToFitCalc(96, new Point(128, 265));

    // aspect ratio should
    assertThat(point).isEqualTo(new Point(46, 96));
  }