Skip to content

Commit 056906c

Browse files
Add unit tests for ArrayUtils, Preconditions, ExtendedSafeRunner and StringConstants
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) - Added StringConstantsTest.java - Improved StringsTest.java with coverage for emptyArray() - Improved StringLengthComparatorTest.java with more precise assertions These tests ensure that core utilities are robust and well-verified. Co-authored-by: RoiSoleil <3462260+RoiSoleil@users.noreply.github.com>
1 parent 65c4fc1 commit 056906c

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package org.moreunit.core.util;
2+
3+
import static org.assertj.core.api.Assertions.assertThat;
4+
5+
import org.junit.Test;
6+
7+
public class StringConstantsTest
8+
{
9+
@Test
10+
public void constants_should_have_expected_values()
11+
{
12+
assertThat(StringConstants.DOT).isEqualTo(".");
13+
assertThat(StringConstants.EMPTY_STRING).isEqualTo("");
14+
assertThat(StringConstants.NEWLINE).isEqualTo(System.getProperty("line.separator"));
15+
assertThat(StringConstants.SLASH).isEqualTo("/");
16+
assertThat(StringConstants.WILDCARD).isEqualTo("*");
17+
}
18+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public void should_return_positive_integer_when_first_has_greater_length_than_se
1515
@Test
1616
public void should_return_negative_integer_when_second_has_greater_length_than_first_parameter() throws Exception
1717
{
18-
assertThat(new StringLengthComparator().compare("", "Long")).isLessThanOrEqualTo(0);
18+
assertThat(new StringLengthComparator().compare("", "Long")).isLessThan(0);
1919
}
2020

2121
@Test

0 commit comments

Comments
 (0)