package de.renew.navigator.gui.actions;

import java.awt.event.ActionEvent;

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

import de.renew.navigator.NavigatorGui;
import de.renew.navigator.models.NavigatorFileTree;
import de.renew.plugin.PluginProperties;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

public class RemoveOneActionTest {
    private RemoveOneAction _removeOneAction;
    private NavigatorGui _gui;
    private PluginProperties _pluginProperties;

    @BeforeEach
    void setUp() {
        _gui = mock(NavigatorGui.class);
        NavigatorFileTree fileTree = mock(NavigatorFileTree.class);
        _pluginProperties = mock(PluginProperties.class);
        _removeOneAction = new RemoveOneAction(_gui, fileTree, _pluginProperties);
    }

    @Test
    public void removeOneActionTest() {
        //given
        ActionEvent actionEvent = mock(ActionEvent.class);

        //when
        _removeOneAction.actionPerformed(actionEvent);

        //then
        verify(_gui).removeSelectedNodes();
    }
}