package de.renew.navigator.gui.actions;

import java.awt.event.ActionEvent;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;

import de.renew.navigator.FilesystemController;

import static org.mockito.Mockito.mock;

public class RefreshAllActionTest {
    private RefreshAllAction refreshAllAction;
    private FilesystemController filesystemController;

    @BeforeEach
    void setUp() {
        //given
        filesystemController = mock(FilesystemController.class);
        refreshAllAction = new RefreshAllAction(filesystemController);
    }

    @Test
    public void testRefreshAllAction() {
        //when
        refreshAllAction.actionPerformed(mock(ActionEvent.class));
        //then
        Mockito.verify(filesystemController).refreshPaths();
    }
}