package net.ranides.assira.collection.query.base;

import net.ranides.test.CQueryAssert;
import org.junit.Test;

import net.ranides.assira.collection.lists.IntRange;
import net.ranides.assira.collection.query.CQuery;

import static org.junit.Assert.*;

public class CQArraySupplierTest {

    @Test
    public void fast() {
        Integer[] input = {1, 2, 3, 4, 5};
        CQuery<Integer> query = CQArraySupplier.from(true, () -> input);

        CQueryAssert.assertEquals(input, query);
    }

    @Test
    public void paralellEach() {
        Integer[] range = new IntRange(0, 50).toArray(new Integer[0]);
        CQueryAssert.assertOrderedParallel(CQArraySupplier.from(() -> range));
    }
}