mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-08 04:43:57 +00:00
added appendArray function
This commit is contained in:
@@ -5,6 +5,7 @@ import org.junit.Test;
|
||||
import static org.hamcrest.CoreMatchers.equalTo;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static strman.Strman.append;
|
||||
import static strman.Strman.appendArray;
|
||||
|
||||
public class StrmanTest {
|
||||
|
||||
@@ -19,4 +20,19 @@ public class StrmanTest {
|
||||
public void appendShouldThrowIllegalArgumentExceptionWhenValueIsNull() throws Exception {
|
||||
append(null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldAppendStringArrayToEndOfValue() throws Exception {
|
||||
assertThat(appendArray("f", new String[]{"o", "o", "b", "a", "r"}), equalTo("foobar"));
|
||||
assertThat(appendArray("foobar", new String[]{}), equalTo("foobar"));
|
||||
assertThat(appendArray("", new String[]{"foobar"}), equalTo("foobar"));
|
||||
}
|
||||
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void appendArrayShouldThrowIllegalArgumentExceptionWhenValueIsNull() throws Exception {
|
||||
appendArray(null, new String[]{});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user