use of io.github.vocabhunter.gui.model.FilterFileModel in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorImpl method translateSession.
private static FilterFileModel translateSession(final BaseListedFile baseListedFile) {
SessionListedFile file = (SessionListedFile) baseListedFile;
FilterFileMode mode;
if (file.isIncludeUnknown()) {
mode = FilterFileMode.SESSION_SEEN;
} else {
mode = FilterFileMode.SESSION_KNOWN;
}
return new FilterFileModel(file.getFile(), mode, Collections.emptySet());
}
use of io.github.vocabhunter.gui.model.FilterFileModel in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method validateToModel.
private void validateToModel(final BaseListedFile file, final FilterFileMode mode, final Set<Integer> columns) {
FilterFileModel model = target.toModel(file);
assertEquals(FILE, model.getFile());
assertEquals(mode, model.getMode());
assertEquals(columns, model.getColumns());
}
use of io.github.vocabhunter.gui.model.FilterFileModel in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testFromSessionKnown.
@Test
public void testFromSessionKnown() {
FilterFileModel model = new FilterFileModel(FILE, FilterFileMode.SESSION_KNOWN, COLUMNS_EMPTY);
validateFromModel(model, new SessionListedFile(FILE, false));
}
use of io.github.vocabhunter.gui.model.FilterFileModel in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testFromDocument.
@Test
public void testFromDocument() {
FilterFileModel model = new FilterFileModel(FILE, FilterFileMode.DOCUMENT, COLUMNS_DOCUMENT);
validateFromModel(model, new DocumentListedFile(FILE));
}
use of io.github.vocabhunter.gui.model.FilterFileModel in project VocabHunter by VocabHunter.
the class FilterFileModelTranslatorTest method testFromExcel.
@Test
public void testFromExcel() {
FilterFileModel model = new FilterFileModel(FILE, FilterFileMode.EXCEL, COLUMNS_EXCEL);
validateFromModel(model, new ExcelListedFile(FILE, COLUMNS_EXCEL));
}
Aggregations