package net.ranides.assira.observable;

import net.ranides.assira.collection.maps.OpenMap;
import net.ranides.assira.events.EventDispatcher;
import net.ranides.assira.events.EventRouter;
import net.ranides.test.ContractTesters;
import net.ranides.test.data.TMap;
import net.ranides.test.data.TMaps;
import net.ranides.test.data.TPoint;
import org.junit.Test;

import static org.junit.Assert.*;

public class ObservableMapTest {
    private final TMap<TPoint, Integer> $map = TMaps.MAP_PI;

    @Test
    public void testSuite() {
        EventRouter router = EventDispatcher.newInstance();
        ContractTesters.runner()
            .param("map!", $map)
            .ignore("MapTester.basicSerializable")
            .ignore("MapTester.basicSerializable_HC")
            .function(new int[0], array -> $map.list(array).into(new ObservableMap<>(router, new OpenMap<>())))
            .run();
    }
}