-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tests): unit test for cardinal detection
- Loading branch information
1 parent
5314d57
commit 831b192
Showing
3 changed files
with
28 additions
and
19 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
27 changes: 27 additions & 0 deletions
27
app/src/test/java/dev/synapsetech/compass/CardinalEnumTest.kt
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,27 @@ | ||
package dev.synapsetech.compass | ||
|
||
import org.junit.Test | ||
|
||
import org.junit.Assert.* | ||
|
||
class CardinalEnumTest { | ||
@Test | ||
fun detection_isCorrect() { | ||
assertEquals(Cardinal.NORTH, Cardinal.fromDegree(0)) | ||
assertEquals(Cardinal.NORTH, Cardinal.fromDegree(360)) | ||
assertEquals(Cardinal.NORTH, Cardinal.fromDegree(10)) | ||
assertEquals(Cardinal.NORTH, Cardinal.fromDegree(350)) | ||
|
||
assertEquals(Cardinal.EAST, Cardinal.fromDegree(90)) | ||
assertEquals(Cardinal.EAST, Cardinal.fromDegree(83)) | ||
assertEquals(Cardinal.EAST, Cardinal.fromDegree(99)) | ||
|
||
assertEquals(Cardinal.SOUTH, Cardinal.fromDegree(180)) | ||
assertEquals(Cardinal.SOUTH, Cardinal.fromDegree(172)) | ||
assertEquals(Cardinal.SOUTH, Cardinal.fromDegree(194)) | ||
|
||
assertEquals(Cardinal.WEST, Cardinal.fromDegree(270)) | ||
assertEquals(Cardinal.WEST, Cardinal.fromDegree(267)) | ||
assertEquals(Cardinal.WEST, Cardinal.fromDegree(286)) | ||
} | ||
} |
17 changes: 0 additions & 17 deletions
17
app/src/test/java/dev/synapsetech/compass/ExampleUnitTest.kt
This file was deleted.
Oops, something went wrong.