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 de.renew.plugin.PluginProperties;

import static org.mockito.Mockito.mock;

public class RefreshAllActionTest {
    private RefreshAllAction _refreshAllAction;
    private FilesystemController _filesystemController;
    private PluginProperties _pluginProperties;

    @BeforeEach
    void setUp() {
        //given
        _filesystemController = mock(FilesystemController.class);
        _pluginProperties = mock(PluginProperties.class);
        _refreshAllAction = new RefreshAllAction(_filesystemController, _pluginProperties);
    }

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