-
Notifications
You must be signed in to change notification settings - Fork 50
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
ab88a6b
commit 9f1587d
Showing
14 changed files
with
116 additions
and
22 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
49 changes: 49 additions & 0 deletions
49
src/test/java/ninjabrainbot/integrationtests/CalibrationIntegrationTests.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,49 @@ | ||
package ninjabrainbot.integrationtests; | ||
|
||
import java.util.Locale; | ||
|
||
import javax.swing.SwingUtilities; | ||
|
||
import ninjabrainbot.gui.frames.CalibrationDialog; | ||
import ninjabrainbot.model.datastate.calibrator.CalibratorFactory; | ||
import ninjabrainbot.util.TestUtils; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class CalibrationIntegrationTests { | ||
|
||
@Test | ||
public void canOpenDialog() { | ||
// Arrange | ||
IntegrationTestBuilder integrationTestBuilder = new IntegrationTestBuilder(); | ||
Locale.setDefault(Locale.US); | ||
CalibratorFactory calibratorFactory = integrationTestBuilder.createCalibratorFactory(); | ||
|
||
// Act + Assert | ||
try { | ||
SwingUtilities.invokeAndWait(() -> { | ||
CalibrationDialog dialog = new CalibrationDialog(TestUtils.createStyleManager(), integrationTestBuilder.preferences, calibratorFactory, integrationTestBuilder.actionExecutor, null, false); | ||
}); | ||
} catch (Exception e) { | ||
Assertions.fail(e); | ||
} | ||
} | ||
|
||
@Test | ||
public void canOpenDialog_manualCalibration() { | ||
// Arrange | ||
IntegrationTestBuilder integrationTestBuilder = new IntegrationTestBuilder(); | ||
Locale.setDefault(Locale.US); | ||
CalibratorFactory calibratorFactory = integrationTestBuilder.createCalibratorFactory(); | ||
|
||
// Act + Assert | ||
try { | ||
SwingUtilities.invokeAndWait(() -> { | ||
CalibrationDialog dialog = new CalibrationDialog(TestUtils.createStyleManager(), integrationTestBuilder.preferences, calibratorFactory, integrationTestBuilder.actionExecutor, null, true); | ||
}); | ||
} catch (Exception e) { | ||
Assertions.fail(e); | ||
} | ||
} | ||
|
||
} |
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
32 changes: 32 additions & 0 deletions
32
src/test/java/ninjabrainbot/integrationtests/ThemeEditorIntegrationTests.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,32 @@ | ||
package ninjabrainbot.integrationtests; | ||
|
||
import java.util.Locale; | ||
|
||
import javax.swing.SwingUtilities; | ||
|
||
import ninjabrainbot.gui.frames.ThemeEditorDialog; | ||
import ninjabrainbot.gui.frames.ThemedDialog; | ||
import ninjabrainbot.gui.style.theme.CustomTheme; | ||
import ninjabrainbot.util.TestUtils; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class ThemeEditorIntegrationTests { | ||
|
||
@Test | ||
public void canOpenDialog() { | ||
// Arrange | ||
IntegrationTestBuilder integrationTestBuilder = new IntegrationTestBuilder(); | ||
Locale.setDefault(Locale.US); | ||
|
||
// Act + Assert | ||
try { | ||
SwingUtilities.invokeAndWait(() -> { | ||
ThemedDialog dialog = new ThemeEditorDialog(TestUtils.createStyleManager(), integrationTestBuilder.preferences, null, new CustomTheme()); | ||
}); | ||
} catch (Exception e) { | ||
Assertions.fail(e); | ||
} | ||
} | ||
|
||
} |
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