add unit test project

This commit is contained in:
kalilistic 2021-04-03 09:15:15 -04:00
parent 78b3550247
commit 4a354ad17e
7 changed files with 154 additions and 1 deletions

View file

@ -0,0 +1,29 @@
using System.IO;
using System.Reflection;
using NUnit.Framework;
namespace Dalamud.Test {
[TestFixture]
public class LocalizationTests {
private Localization localization;
private string currentLangCode;
private string workingDir;
[OneTimeSetUp]
public void Init() {
this.workingDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
}
[SetUp]
public void Setup() {
this.localization = new Localization(this.workingDir);
this.localization.OnLocalizationChanged += code => this.currentLangCode = code;
}
[Test]
public void SetupWithFallbacks_EventInvoked() {
this.localization.SetupWithFallbacks();
Assert.AreEqual("en", this.currentLangCode);
}
}
}