mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2025-01-01 20:25:07 +08:00
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");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|