54 lines
1021 B
Java
54 lines
1021 B
Java
package app.settings;
|
|
|
|
|
|
|
|
import java.io.File;
|
|
import java.io.IOException;
|
|
import java.nio.file.Paths;
|
|
import java.util.Arrays;
|
|
import java.util.List;
|
|
|
|
import com.google.common.eventbus.EventBus;
|
|
|
|
import org.junit.jupiter.api.DisplayName;
|
|
import org.junit.jupiter.api.Test;
|
|
import org.junit.jupiter.api.io.TempDir;
|
|
import org.mockito.InjectMocks;
|
|
import org.mockito.Mock;
|
|
|
|
public class SettingsProviderTest {
|
|
|
|
@TempDir
|
|
File tmp;
|
|
|
|
@Mock
|
|
private String SETTINGS_PATH = Paths.get(tmp.toPath().toString(), "BNNsetting.dat").toString();
|
|
|
|
|
|
@Mock
|
|
private List<String> legalSettings =
|
|
Arrays.asList("Java", "Markdown", "Monokai", "Solarized Light");
|
|
|
|
private EventBus eventBus;
|
|
|
|
|
|
@InjectMocks
|
|
private SettingsProvider sp;
|
|
|
|
@Test
|
|
@DisplayName("Test load settings")
|
|
public void testLoadSettings() throws IOException {
|
|
File f = new File(tmp, "test.txt");
|
|
f.createNewFile();
|
|
|
|
}
|
|
|
|
@Test
|
|
@DisplayName("Test save settings")
|
|
public void testSaveSettings() {
|
|
|
|
|
|
}
|
|
|
|
}
|