21 lines
632 B
Java
21 lines
632 B
Java
package com.fabiosalvini.permutations;
|
|
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.IOException;
|
|
|
|
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
|
|
|
public class ElementsInputReaderTest {
|
|
|
|
@Test
|
|
public void readElements() throws IOException {
|
|
byte[] input = "123,456,789".getBytes();
|
|
ByteArrayInputStream inputStream = new ByteArrayInputStream(input);
|
|
ElementsInputReader reader = new ElementsInputReader(inputStream);
|
|
long[] elements = reader.readElements();
|
|
assertArrayEquals(new long[]{123, 456, 789}, elements);
|
|
}
|
|
}
|