Dalamud/Dalamud.Test/LocalizationTests.cs
2021-04-04 10:47:30 -04:00

22 lines
713 B
C#

using System.IO;
using System.Reflection;
using Xunit;
namespace Dalamud.Test {
public class LocalizationTests {
private readonly Localization localization;
private string currentLangCode;
public LocalizationTests() {
var workingDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
this.localization = new Localization(workingDir);
this.localization.OnLocalizationChanged += code => this.currentLangCode = code;
}
[Fact]
public void SetupWithFallbacks_EventInvoked() {
this.localization.SetupWithFallbacks();
Assert.Equal("en", this.currentLangCode);
}
}
}