-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test to ensure that all supported languages have language f…
…lag icons (#688)
- Loading branch information
1 parent
96a4062
commit c17773a
Showing
1 changed file
with
29 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/test/java/org/terasology/launcher/util/ResourceTests.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,29 @@ | ||
// Copyright 2022 The Terasology Foundation | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
package org.terasology.launcher.util; | ||
|
||
import org.junit.jupiter.api.extension.ExtendWith; | ||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
import org.testfx.framework.junit5.ApplicationExtension; | ||
|
||
import java.util.Locale; | ||
import java.util.stream.Stream; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
@ExtendWith(ApplicationExtension.class) | ||
class ResourceTests { | ||
|
||
private static Stream<Arguments> provideSupportedLocales() { | ||
return I18N.getSupportedLocales().stream().map(Arguments::of); | ||
} | ||
|
||
@ParameterizedTest | ||
@MethodSource("provideSupportedLocales") | ||
void ensureAllSupportedLocalesHaveFlagIcons(Locale locale) { | ||
assertNotNull(I18N.getFxImage("flag_" + locale.toLanguageTag())); | ||
} | ||
} |