package pipe.historyActions;

import org.junit.Before;
import org.junit.Test;
import pipe.models.component.arc.ArcPoint;

import static org.mockito.Mockito.*;

public class ArcPathPointTypeTest {
    ArcPathPointType historyItem;
    ArcPoint mockPoint;

    @Before
    public void setUp() {
        mockPoint  = mock(ArcPoint.class);
        historyItem = new ArcPathPointType(mockPoint);
    }

    @Test
    public void togglesArcPointTypeToStraightOnUndo() {
        when(mockPoint.isCurved()).thenReturn(true);

        historyItem.undo();
        verify(mockPoint).setCurved(false);
    }

    @Test
    public void togglesArcPointTypeToCurvedOnUndo() {
        when(mockPoint.isCurved()).thenReturn(false);

        historyItem.undo();
        verify(mockPoint).setCurved(true);
    }

    @Test
    public void togglesArcPointTypeToStraightOnRedo() {
        when(mockPoint.isCurved()).thenReturn(true);

        historyItem.redo();
        verify(mockPoint).setCurved(false);
    }

    @Test
    public void togglesArcPointTypeToCurvedOnRedo() {
        when(mockPoint.isCurved()).thenReturn(false);

        historyItem.redo();
        verify(mockPoint).setCurved(true);
    }


}

@@ -210,24 +210,17 @@
 intType 
-historyI
+i
 tem;%0A   
@@ -330,24 +330,17 @@
         
-historyI
+i
 tem = ne
@@ -501,32 +501,25 @@
 );%0A%0A        
-historyI
+i
 tem.undo();%0A
@@ -692,32 +692,25 @@
 );%0A%0A        
-historyI
+i
 tem.undo();%0A
@@ -817,32 +817,53 @@
 aightOnRedo() %7B%0A
+        item.undo();%0A
         when(moc
@@ -904,32 +904,25 @@
 );%0A%0A        
-historyI
+i
 tem.redo();%0A
@@ -1028,32 +1028,53 @@
 urvedOnRedo() %7B%0A
+        item.undo();%0A
         when(moc
@@ -1124,16 +1124,9 @@
     
-historyI
+i
 tem.
@@ -1149,32 +1149,42 @@
 verify(mockPoint
+, times(2)
 ).setCurved(true

Fix tests in pipe-gui, for #42