-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4723bd1
commit ebc7366
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
source/core/src/test/com/csse3200/game/utils/math/GridPoint2UtilsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.csse3200.game.utils.math; | ||
|
||
import com.badlogic.gdx.math.GridPoint2; | ||
import org.junit.jupiter.api.Test; | ||
import static org.junit.jupiter.api.Assertions.*; | ||
|
||
public class GridPoint2UtilsTest { | ||
|
||
/** | ||
* testZero() ensures that GridPoint2Utils.ZERO constant is (0, 0). | ||
* GridPoint2Utils.ZERO is a constant representing the point (0, 0). | ||
*/ | ||
@Test | ||
public void testZero() { | ||
GridPoint2 zero = GridPoint2Utils.ZERO; | ||
assertEquals(0, zero.x); | ||
assertEquals(0, zero.y); | ||
} | ||
|
||
/** | ||
* testInstantiation() checks if private constructor of GridPoint2Utils throws an exception | ||
* while creating an instance. | ||
*/ | ||
@Test | ||
public void testInstantiation() { | ||
assertThrows(IllegalStateException.class, () -> { | ||
GridPoint2Utils.createInstance(); | ||
}); | ||
} | ||
} |