-
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.
Merge pull request #188 from CentralValleyModeling/feature/interval-n…
…ame-check-monthly add helper utility function for checking if the interval is monthly
- Loading branch information
Showing
3 changed files
with
54 additions
and
13 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
30 changes: 30 additions & 0 deletions
30
wrims-core/src/test/java/wrimsv2/components/ControllerBatchTest.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 @@ | ||
/* | ||
* Water Resource Integrated Modeling System (WRIMS) Copyright (c) 2024. | ||
* | ||
* WRIMS 2 is copyrighted by the State of California Department of Water Resources. | ||
* It is licensed under the Eclipse Public License, Version 1.0. | ||
* See Eclipse Public License for more details. | ||
*/ | ||
|
||
package wrimsv2.components; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.CsvSource; | ||
|
||
final class ControllerBatchTest { | ||
|
||
@CsvSource({"1Month", "1MON", "1month", "1mon", "1mOnTh", "1MoN"}) | ||
@ParameterizedTest | ||
void testIsMonthlyInterval(String intervalName) { | ||
assertTrue(ControllerBatch.isMonthlyInterval(intervalName), "Interval: " + intervalName + " should be monthly"); | ||
} | ||
|
||
@CsvSource({"1DAY", "1Day", "1DaY"}) | ||
@ParameterizedTest | ||
void testIsNotMonthlyInterval(String intervalName) { | ||
assertFalse(ControllerBatch.isMonthlyInterval(intervalName), "Interval: " + intervalName + " should not be monthly"); | ||
} | ||
} |