package no.ssb.vtl.model;

import org.junit.Test;

import java.time.Instant;
import java.util.Arrays;
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;


public class DataPointTest {

    @Test
    public void testCreateWithCapacity() {
        DataPoint point = DataPoint.create(5);
        assertThat(point).containsExactly(
                VTLObject.NULL,
                VTLObject.NULL,
                VTLObject.NULL,
                VTLObject.NULL,
                VTLObject.NULL
        );
    }

    @Test
    public void testCreateWithSource() {
        List<VTLObject> source = Arrays.asList(
                VTLObject.of(0L),
                VTLObject.of(0.0D),
                VTLObject.of(""),
                VTLObject.of(false),
                VTLObject.of(Instant.EPOCH),
                VTLObject.NULL
        );

        DataPoint point = DataPoint.create(source);
        assertThat(point).containsExactlyElementsOf(
                source
        );
    }

    @Test
    public void testCreateWithoutConversion() {
        List<VTLObject> source = Arrays.asList(
                VTLObject.of(0L),
                VTLObject.of(0.0D),
                VTLObject.of(""),
                VTLObject.of(false),
                VTLObject.of(Instant.EPOCH),
                VTLObject.NULL
        );



        DataPoint point = DataPoint.create(
                VTLObject.of(0L),
                VTLObject.of(0.0D),
                VTLObject.of(""),
                VTLObject.of(false),
                VTLObject.of(Instant.EPOCH),
                VTLObject.NULL
        );

        assertThat(point).containsExactlyElementsOf(
                source
        );
    }

    @Test
    public void testCreateWithConversion() {
        List<VTLObject> source = Arrays.asList(
                VTLObject.of(0L),
                VTLObject.of(0.0D),
                VTLObject.of(""),
                VTLObject.of(false),
                VTLObject.of(Instant.EPOCH),
                VTLObject.NULL
        );



        DataPoint point = DataPoint.create(
                0L,
                0.0D,
                "",
                false,
                Instant.EPOCH,
                null
        );

        assertThat(point).containsExactlyElementsOf(
                source
        );
    }
}
@@ -20,16 +20,795 @@
 model;%0A%0A
+/*-%0A * ========================LICENSE_START=================================%0A * Java VTL%0A * %25%25%0A * Copyright (C) 2016 - 2017 Hadrien Kohl%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * =========================LICENSE_END==================================%0A */%0A%0A
 import o

Add missing header to DataPointTest.java