mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Convert Display and Video fully over to properties
This commit is contained in:
@@ -1815,6 +1815,24 @@ namespace SabreTools.Data.Extensions.Test
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null, null)]
|
||||
[InlineData("0", Rotation.North)]
|
||||
[InlineData("north", Rotation.North)]
|
||||
[InlineData("vertical", Rotation.North)]
|
||||
[InlineData("90", Rotation.East)]
|
||||
[InlineData("east", Rotation.East)]
|
||||
[InlineData("horizontal", Rotation.East)]
|
||||
[InlineData("180", Rotation.South)]
|
||||
[InlineData("south", Rotation.South)]
|
||||
[InlineData("270", Rotation.West)]
|
||||
[InlineData("west", Rotation.West)]
|
||||
public void AsRotationTest(string? field, Rotation? expected)
|
||||
{
|
||||
Rotation? actual = field.AsRotation();
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null, null)]
|
||||
[InlineData("no", Runnable.No)]
|
||||
@@ -2124,6 +2142,21 @@ namespace SabreTools.Data.Extensions.Test
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(Rotation.North, true, "vertical")]
|
||||
[InlineData(Rotation.North, false, "0")]
|
||||
[InlineData(Rotation.East, true, "horizontal")]
|
||||
[InlineData(Rotation.East, false, "90")]
|
||||
[InlineData(Rotation.South, true, "vertical")]
|
||||
[InlineData(Rotation.South, false, "180")]
|
||||
[InlineData(Rotation.West, true, "horizontal")]
|
||||
[InlineData(Rotation.West, false, "270")]
|
||||
public void FromRotationTest(Rotation field, bool useSecond, string? expected)
|
||||
{
|
||||
string? actual = field.AsStringValue(useSecond);
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData((Runnable)int.MaxValue, null)]
|
||||
[InlineData(Runnable.No, "no")]
|
||||
|
||||
Reference in New Issue
Block a user