-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: sanity checks on result records
Also minor improvements of sunrise/sunset tests and docs.
- Loading branch information
1 parent
1436679
commit 70db663
Showing
5 changed files
with
99 additions
and
39 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
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
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
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
21 changes: 21 additions & 0 deletions
21
src/test/java/net/e175/klaus/solarpositioning/test/SolarPositionTest.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,21 @@ | ||
package net.e175.klaus.solarpositioning.test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertThrows; | ||
|
||
import net.e175.klaus.solarpositioning.SolarPosition; | ||
import org.junit.jupiter.api.Test; | ||
|
||
class SolarPositionTest { | ||
|
||
@Test | ||
public void rejectsSillyAzimuth() { | ||
assertThrows(IllegalArgumentException.class, () -> new SolarPosition(-0.1, 90)); | ||
assertThrows(IllegalArgumentException.class, () -> new SolarPosition(360.1, 90)); | ||
} | ||
|
||
@Test | ||
public void rejectsSillyZenithAngle() { | ||
assertThrows(IllegalArgumentException.class, () -> new SolarPosition(90, -0.1)); | ||
assertThrows(IllegalArgumentException.class, () -> new SolarPosition(90, 180.1)); | ||
} | ||
} |