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 java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import static org.junit.Assert.*;

public class CQCollectionSupplierTest {

    @Test
    public void fast() {
        List<Integer> input = Arrays.asList(1, 2, 3, 4, 5);
        CQuery<Integer> query = CQCollectionSupplier.from(true, () -> input);

        CQueryAssert.assertEquals(input, query);
    }

    @Test
    public void paralellEach() {
        List<Integer> range = new ArrayList<>(new IntRange(0, 50));
        CQueryAssert.assertOrderedParallel(CQCollectionSupplier.from(true, () -> range));
    }
}