-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathHolySiteEffectMapperTests.cs
More file actions
22 lines (19 loc) · 993 Bytes
/
HolySiteEffectMapperTests.cs
File metadata and controls
22 lines (19 loc) · 993 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
using ImperatorToCK3.Mappers.Modifier;
using System.Collections.Generic;
using Xunit;
namespace ImperatorToCK3.UnitTests.Mappers.HolySiteEffect;
public class HolySiteEffectMapperTests {
[Theory, MemberData(nameof(TestData))]
public void MapperReturnsCorrectValues(string imperatorEffect, double imperatorValue, KeyValuePair<string, double>? match) {
const string mappingsFilePath = "TestFiles/HolySiteEffectMapperTests/mappings.txt";
var mapper = new ModifierMapper(mappingsFilePath);
Assert.Equal(match, mapper.Match(imperatorEffect, imperatorValue));
}
public static IEnumerable<object?[]> TestData =>
new List<object?[]> {
new object?[] { "wrong_effect", 1, null },
new object?[] { "effect_to_multiply", 2, new KeyValuePair<string, double>("doubled_effect", 4) },
new object?[] { "effect_to_divide", 4, new KeyValuePair<string, double>("divided_effect", 2) },
new object?[] { "effect_to_nullify", 1, new KeyValuePair<string, double>("nullified_effect", 0)}
};
}