Skip to content

Commit b2bd3ab

Browse files
stephenokeefeItneet
authored andcommitted
Add test coverage
1 parent f8a3e78 commit b2bd3ab

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test/java/uk/gov/hmcts/darts/util/DataUtilTest.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,4 +306,24 @@ void isWithinBounds_shouldReturnFalse_WhenValueIsBelowMin() {
306306
assertThat(DataUtil.isWithinBounds(0L, 1L, 10L)).isFalse();
307307
}
308308

309+
@Test
310+
void isWithinBounds_shouldReturnFalse_WhenValueIsAboveMax() {
311+
assertThat(DataUtil.isWithinBounds(11L, 1L, 10L)).isFalse();
312+
}
313+
314+
@Test
315+
void isWithinBounds_shouldReturnTrue_WhenValueIsEqualToMin() {
316+
assertThat(DataUtil.isWithinBounds(1L, 1L, 10L)).isTrue();
317+
}
318+
319+
@Test
320+
void isWithinBounds_shouldReturnTrue_WhenValueIsEqualToMax() {
321+
assertThat(DataUtil.isWithinBounds(10L, 1L, 10L)).isTrue();
322+
}
323+
324+
@Test
325+
void isWithinBounds_shouldReturnFalseWhenValueIsNull() {
326+
assertThat(DataUtil.isWithinBounds(null, 1L, 10L)).isFalse();
327+
}
328+
309329
}

0 commit comments

Comments
 (0)