package es.tid.cosmos.mobility.util;

import java.io.IOException;
import java.io.StringReader;
import java.util.List;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;

import es.tid.cosmos.mobility.data.MobProtocol.Cell;

/**
 *
 * @author dmicol
 */
public class CellsCatalogueTest {
    @Test
    public void testLoad() throws IOException {
        String text = "334305|2221436242|12|34|56|78\n"
                + "334306|2221436242|12|34|56|78\n"
                + "334307|2221436242|12|34|56|78";
        List<Cell> cells = CellsCatalogue.load(new StringReader(text));
        assertNotNull(cells);
        assertEquals(3, cells.size());
        assertEquals(3359493L, cells.get(0).getCellId());
        assertEquals(3359494L, cells.get(1).getCellId());
        assertEquals(3359495L, cells.get(2).getCellId());
    }
}

@@ -378,16 +378,25 @@
 testLoad
+Andfilter
 () throw
@@ -411,16 +411,16 @@
 ption %7B%0A
-
         
@@ -567,16 +567,68 @@
 34%7C56%7C78
+%5Cn%22%0A                + %22334305%7C2221436242%7C12%7C34%7C56%7C78
 %22;%0A     
@@ -745,17 +745,17 @@
 tEquals(
-3
+4
 , cells.
@@ -871,32 +871,32 @@
 ).getCellId());%0A
-
         assertEq
@@ -933,20 +933,315 @@
 tCellId());%0A
+        assertEquals(3359493L, cells.get(3).getCellId());%0A        %0A        List%3CCell%3E filteredCells = CellsCatalogue.filter(cells, 3359493L);%0A        assertEquals(2, filteredCells.size());%0A        for (Cell cell : filteredCells) %7B%0A            assertEquals(3359493L, cell.getCellId());%0A        %7D%0A
     %7D%0A%7D%0A

Add unit test for CellsCatalogue.filter.