1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-16 22:17:19 +08:00

Expand test coverage for parsing bool skin config values

This commit is contained in:
Bartłomiej Dach 2022-06-06 19:57:08 +02:00
parent 3862681d94
commit 211f0d1e04
No known key found for this signature in database
GPG Key ID: BCECCD4FA41F6497

@ -59,11 +59,13 @@ namespace osu.Game.Tests.Skins
AddAssert("Check float parse lookup", () => requester.GetConfig<string, float>("FloatTest")?.Value == 1.1f); AddAssert("Check float parse lookup", () => requester.GetConfig<string, float>("FloatTest")?.Value == 1.1f);
} }
[Test] [TestCase("0", false)]
public void TestBoolLookup() [TestCase("1", true)]
[TestCase("2", true)] // https://github.com/ppy/osu/issues/18579
public void TestBoolLookup(string originalValue, bool expectedParsedValue)
{ {
AddStep("Add config values", () => userSource.Configuration.ConfigDictionary["BoolTest"] = "1"); AddStep("Add config values", () => userSource.Configuration.ConfigDictionary["BoolTest"] = originalValue);
AddAssert("Check bool parse lookup", () => requester.GetConfig<string, bool>("BoolTest")?.Value == true); AddAssert("Check bool parse lookup", () => requester.GetConfig<string, bool>("BoolTest")?.Value == expectedParsedValue);
} }
[Test] [Test]