-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unit test for loading a CK3 name list
- Loading branch information
1 parent
1725bd4
commit a648e41
Showing
2 changed files
with
46 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using commonItems; | ||
using Xunit; | ||
|
||
namespace ImperatorToCK3.UnitTests.CK3.Cultures; | ||
|
||
public class NameListTests { | ||
[Fact] | ||
public void NameListIsCorrectlyLoaded() { | ||
var reader = new BufferedReader(""" | ||
{ | ||
male_names = { | ||
John | ||
"Alexander" | ||
2 = { Tom "Mark" } | ||
} | ||
female_names = { | ||
Jane | ||
"Alexandra" | ||
2 = { Sandra "Maria" } | ||
} | ||
"""); | ||
var nameList = new ImperatorToCK3.CK3.Cultures.NameList("test", reader); | ||
|
||
Assert.Equal("test", nameList.Id); | ||
Assert.Collection(nameList.MaleNames, | ||
item => Assert.Equal("John", item), | ||
item => Assert.Equal("Alexander", item), | ||
item => Assert.Equal("Tom", item), | ||
item => Assert.Equal("Mark", item) | ||
); | ||
Assert.Collection(nameList.FemaleNames, | ||
item => Assert.Equal("Jane", item), | ||
item => Assert.Equal("Alexandra", item), | ||
item => Assert.Equal("Sandra", item), | ||
item => Assert.Equal("Maria", item) | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters