|
20 | 20 | package org.neo4j.gds.core.loading;
|
21 | 21 |
|
22 | 22 | import org.junit.jupiter.api.Test;
|
23 |
| - |
24 | 23 | import org.neo4j.gds.values.primitive.PrimitiveValues;
|
25 | 24 | import org.neo4j.values.storable.Values;
|
26 | 25 |
|
27 | 26 | import static org.assertj.core.api.Assertions.assertThat;
|
28 | 27 |
|
29 | 28 | class GdsNeo4jValueConverterTest {
|
| 29 | + |
30 | 30 | @Test
|
31 | 31 | void shouldConvertFloatArray() {
|
32 | 32 | assertThat(GdsNeo4jValueConverter.toValue(Values.of(new float[]{1, -1})))
|
33 | 33 | .isEqualTo(PrimitiveValues.floatArray(new float[]{1, -1}));
|
34 | 34 | }
|
| 35 | + |
| 36 | + @Test |
| 37 | + void shouldConvertDoubleArray() { |
| 38 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(new double[]{1, -1}))) |
| 39 | + .isEqualTo(PrimitiveValues.doubleArray(new double[]{1, -1})); |
| 40 | + } |
| 41 | + @Test |
| 42 | + void shouldConvertLongArray() { |
| 43 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(new long[]{1, -1}))) |
| 44 | + .isEqualTo(PrimitiveValues.longArray(new long[]{1, -1})); |
| 45 | + } |
| 46 | + |
| 47 | + @Test |
| 48 | + void shouldConvertIntArray() { |
| 49 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(new int[]{1, -1}))) |
| 50 | + .isEqualTo(PrimitiveValues.intArray(new int[]{1, -1})); |
| 51 | + } |
| 52 | + |
| 53 | + @Test |
| 54 | + void shouldConvertShortArray() { |
| 55 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(new short[]{1, -1}))) |
| 56 | + .isEqualTo(PrimitiveValues.shortArray(new short[]{1, -1})); |
| 57 | + } |
| 58 | + |
| 59 | + @Test |
| 60 | + void shouldConvertByteArray() { |
| 61 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(new byte[]{1, -1}))) |
| 62 | + .isEqualTo(PrimitiveValues.byteArray(new byte[]{1, -1})); |
| 63 | + } |
| 64 | + |
| 65 | + @Test |
| 66 | + void shouldConvertFloat() { |
| 67 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(1F))) |
| 68 | + .isEqualTo(PrimitiveValues.floatingPointValue(1F)); |
| 69 | + } |
| 70 | + |
| 71 | + @Test |
| 72 | + void shouldConvertDouble() { |
| 73 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(1D))) |
| 74 | + .isEqualTo(PrimitiveValues.floatingPointValue(1D)); |
| 75 | + } |
| 76 | + |
| 77 | + @Test |
| 78 | + void shouldConvertInt() { |
| 79 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(1))) |
| 80 | + .isEqualTo(PrimitiveValues.longValue(1)); |
| 81 | + } |
| 82 | + |
| 83 | + @Test |
| 84 | + void shouldConvertLong() { |
| 85 | + assertThat(GdsNeo4jValueConverter.toValue(Values.of(1L))) |
| 86 | + .isEqualTo(PrimitiveValues.longValue(1L)); |
| 87 | + } |
| 88 | + |
35 | 89 | }
|
0 commit comments