mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 18:27:23 +01:00
Add tests for GameVersionConverter and fix edge case (#1726)
- Adds tests for GameVersionConverter - Refactors GameVersionConverter to reduce nesting - Fixes an edge case in GameVersion deserialization in which the JsonConstructor will be invoked even if no properties match - Adds a test for the GameVersion deserialization edge case
This commit is contained in:
parent
7fcd10ecd8
commit
d393fa64b6
4 changed files with 171 additions and 22 deletions
|
|
@ -225,6 +225,17 @@ namespace Dalamud.Test.Game
|
|||
Assert.Throws<ArgumentOutOfRangeException>(() => JsonConvert.DeserializeObject<GameVersion>(serialized));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VersionInvalidTypeDeserialization()
|
||||
{
|
||||
var serialized = """
|
||||
{
|
||||
"Value": "Hello"
|
||||
}
|
||||
""";
|
||||
Assert.Throws<JsonSerializationException>(() => JsonConvert.DeserializeObject<GameVersion>(serialized));
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VersionConstructorNegativeYear()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue