mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Reduce extension confusion
This commit is contained in:
@@ -1851,6 +1851,19 @@ namespace SabreTools.Data.Extensions.Test
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null, null)]
|
||||
[InlineData("INVALID", null)]
|
||||
[InlineData("yes", true)]
|
||||
[InlineData("True", true)]
|
||||
[InlineData("no", false)]
|
||||
[InlineData("False", false)]
|
||||
public void AsYesNoTest(string? field, bool? expected)
|
||||
{
|
||||
bool? actual = field.AsYesNo();
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Enum to String
|
||||
@@ -2137,6 +2150,16 @@ namespace SabreTools.Data.Extensions.Test
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(null, null)]
|
||||
[InlineData(true, "yes")]
|
||||
[InlineData(false, "no")]
|
||||
public void FromYesNo(bool? field, string? expected)
|
||||
{
|
||||
string? actual = field.FromYesNo();
|
||||
Assert.Equal(expected, actual);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user