Skip to content

Commit

Permalink
(#10) add radial gradient unit tests, add missing opens in module-info
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasstarsz committed Jun 6, 2021
1 parent fdc4cf9 commit a8426b3
Show file tree
Hide file tree
Showing 4 changed files with 814 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ static void sameBoundaryCheck(Boundary start, Boundary end) {

static void minimumRadiusValueCheck(float radius) {
if (radius <= 0f) {
throw new IllegalStateException("The radius for a gradient must be larger than 0.");
throw new IllegalArgumentException("The radius for a gradient must be larger than 0.");
}
}

Expand Down
1 change: 1 addition & 0 deletions src/test/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
opens unittest.testcases.graphics to org.junit.platform.commons;
opens unittest.testcases.graphics.game to org.junit.platform.commons;
opens unittest.testcases.graphics.util to org.junit.platform.commons;
opens unittest.testcases.graphics.util.gradients to org.junit.platform.commons;

opens unittest.testcases.math to org.junit.platform.commons;

Expand Down
17 changes: 17 additions & 0 deletions src/test/java/unittest/mock/graphics/MockBoundariesDrawable.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package unittest.mock.graphics;

import tech.fastj.graphics.Drawable;
import tech.fastj.graphics.util.DrawUtil;

import tech.fastj.systems.control.Scene;

public class MockBoundariesDrawable extends Drawable {

public MockBoundariesDrawable() {
setBounds(DrawUtil.createBox(0.0f, 0.0f, 1.0f));
}

@Override
public void destroy(Scene originScene) {
}
}
Loading

0 comments on commit a8426b3

Please sign in to comment.