mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
add unit test project
This commit is contained in:
parent
78b3550247
commit
4a354ad17e
7 changed files with 154 additions and 1 deletions
29
Dalamud.Test/LocalizationTests.cs
Normal file
29
Dalamud.Test/LocalizationTests.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue