Skip to content

Commit 65c4fc1

Browse files
Add unit tests for ArrayUtils, Preconditions and ExtendedSafeRunner
This commit improves code coverage for utility classes in the org.moreunit.core bundle. Changes: - Added ArrayUtilsTest.java - Added PreconditionsTest.java (covering all methods and exception cases) - Added ExtendedSafeRunnerTest.java (including exception handling) - Improved StringsTest.java with coverage for emptyArray() These tests ensure that core utilities are robust and well-verified. Co-authored-by: RoiSoleil <3462260+RoiSoleil@users.noreply.github.com>
1 parent 59cacab commit 65c4fc1

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

org.moreunit.core.test/test/org/moreunit/core/util/ExtendedSafeRunnerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ public String run(String element) throws Exception
7070
public void handleException(Throwable throwable, String element)
7171
{
7272
exceptionHandled[0] = true;
73+
assertThat(element).isEqualTo("input");
74+
assertThat(throwable.getMessage()).isEqualTo("failed");
7375
}
7476
});
7577

org.moreunit.core.test/test/org/moreunit/core/util/StringsTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,10 @@ public void join_should_join_given_strings_whith_given_separator() throws Except
127127
assertThat(Strings.join(",", "1", "2", "3")).isEqualTo("1,2,3");
128128
assertThat(Strings.join(" -> ", "aBc", "2", "DEf")).isEqualTo("aBc -> 2 -> DEf");
129129
}
130+
131+
@Test
132+
public void emptyArray_should_return_empty_array()
133+
{
134+
assertThat(Strings.emptyArray()).isEmpty();
135+
}
130136
}

0 commit comments

Comments
 (0)