package net.ros.common.grid;

import net.ros.common.grid.impl.PipeGrid;
import net.ros.common.grid.node.IFluidPipe;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;

import static org.mockito.Mockito.*;

@RunWith(MockitoJUnitRunner.class)
public class PipeGridTest
{
    @Before
    public void setupTest()
    {
        GridManager.getInstance().cableGrids.clear();
    }

    @Test
    public void testPipeList()
    {
        PipeGrid grid = new PipeGrid(0);
        IFluidPipe pipe = mock(IFluidPipe.class);

        when(pipe.isInput()).thenReturn(true);
        when(pipe.isOutput()).thenReturn(true);

        grid.addCable(pipe);
        grid.addConnectedPipe(pipe);
        grid.tick();

        verify(pipe, times(1)).fillNeighbors();
        verify(pipe, times(1)).drainNeighbors();
    }
}

@@ -23,16 +23,60 @@
 .grid;%0A%0A
+import net.minecraftforge.fluids.FluidTank;%0A
 import n
@@ -721,16 +721,81 @@
 n(true);
+%0A        when(pipe.getBufferTank()).thenReturn(new FluidTank(0));
 %0A%0A      

Fix unit test