mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
ddbc3b164b
* chore: rearrange package structure to have the package at the root * ci: update CI workflows * ci: fixing workflow bugs * ci: recurse building .zip package * ci: more fixes * ci: add back in the nadena.dev VPM repo * ci: fix tests
35 lines
1.0 KiB
C#
35 lines
1.0 KiB
C#
using nadena.dev.modular_avatar.core.editor;
|
|
using NUnit.Framework;
|
|
|
|
namespace modular_avatar_tests
|
|
{
|
|
public class LocalizationTest
|
|
{
|
|
[SetUp]
|
|
public void Setup()
|
|
{
|
|
Localization.OverrideLanguage = null;
|
|
Localization.Reload();
|
|
}
|
|
|
|
[TearDown]
|
|
public void Teardown()
|
|
{
|
|
Localization.OverrideLanguage = null;
|
|
}
|
|
|
|
[Test]
|
|
public void TestLanguageFallback()
|
|
{
|
|
Localization.OverrideLanguage = "test";
|
|
Assert.AreEqual(Localization.S("test0.test_a"), "replaced");
|
|
Assert.AreEqual(Localization.S("test0.test_b"), "test_b");
|
|
Assert.AreEqual(Localization.S("test0.test_c"), "test0.test_c");
|
|
|
|
Localization.OverrideLanguage = "en";
|
|
Assert.AreEqual(Localization.S("test0.test_a"), "test_a");
|
|
Assert.AreEqual(Localization.S("test0.test_b"), "test_b");
|
|
Assert.AreEqual(Localization.S("test0.test_c"), "test0.test_c");
|
|
}
|
|
}
|
|
} |