-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
db2e5c1
commit 1d0bd0c
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
src/test/java/de/danielluedecke/zettelkasten/UpdateDisplayOptionsTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
package de.danielluedecke.zettelkasten; | ||
|
||
import org.testng.Assert; | ||
import org.testng.annotations.Test; | ||
|
||
public class UpdateDisplayOptionsTest { | ||
|
||
@Test | ||
public void testDefaultOptions() { | ||
UpdateDisplayOptions options = UpdateDisplayOptions.defaultOptions(); | ||
Assert.assertTrue(options.shouldUpdateNoteSequencesTree()); | ||
Assert.assertTrue(options.shouldUpdateLinksTable()); | ||
Assert.assertTrue(options.shouldUpdateTitlesTab()); | ||
} | ||
|
||
@Test | ||
public void testCustomOptions() { | ||
UpdateDisplayOptions options = new UpdateDisplayOptions.UpdateDisplayOptionsBuilder() | ||
.updateNoteSequencesTab(false) | ||
.updateLinksTab(true) | ||
.updateTitlesTab(false) | ||
.build(); | ||
|
||
Assert.assertFalse(options.shouldUpdateNoteSequencesTree()); | ||
Assert.assertTrue(options.shouldUpdateLinksTable()); | ||
Assert.assertFalse(options.shouldUpdateTitlesTab()); | ||
} | ||
|
||
@Test | ||
public void testBuilderWithExistingOptions() { | ||
UpdateDisplayOptions originalOptions = new UpdateDisplayOptions.UpdateDisplayOptionsBuilder() | ||
.updateNoteSequencesTab(false) | ||
.updateLinksTab(false) | ||
.updateTitlesTab(true) | ||
.build(); | ||
|
||
UpdateDisplayOptions newOptions = new UpdateDisplayOptions.UpdateDisplayOptionsBuilder(originalOptions) | ||
.updateNoteSequencesTab(true) | ||
.build(); | ||
|
||
Assert.assertTrue(newOptions.shouldUpdateNoteSequencesTree()); | ||
Assert.assertFalse(newOptions.shouldUpdateLinksTable()); | ||
Assert.assertTrue(newOptions.shouldUpdateTitlesTab()); | ||
} | ||
} |