BAEL-2392_Java_String_interview_questions second commit (#6064)
This commit is contained in:
committed by
Josh Cummings
parent
829b11e1f3
commit
bdcc961542
@@ -0,0 +1,17 @@
|
||||
package com.baeldung.string.interview;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
public class StringToCharArrayUnitTest {
|
||||
@Test
|
||||
public void whenConvertingStringToCharArray_thenConversionSuccessful() {
|
||||
String beforeConvStr = "hello";
|
||||
char[] afterConvCharArr = { 'h', 'e', 'l', 'l', 'o' };
|
||||
|
||||
assertEquals(Arrays.equals(beforeConvStr.toCharArray(), afterConvCharArr), true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user