Add test coverage for skin background source

This commit is contained in:
Bartłomiej Dach 2021-06-08 21:58:44 +02:00
parent 5bf4dd6358
commit d86ace4d11

View File

@ -35,7 +35,7 @@ namespace osu.Game.Tests.Visual.Background
} }
[Test] [Test]
public void TestTogglingStoryboardSwitchesBackgroundType() public void TestBackgroundTypeSwitch()
{ {
setSupporter(true); setSupporter(true);
@ -44,6 +44,9 @@ namespace osu.Game.Tests.Visual.Background
setSourceMode(BackgroundSource.BeatmapWithStoryboard); setSourceMode(BackgroundSource.BeatmapWithStoryboard);
AddUntilStep("is storyboard background", () => getCurrentBackground() is BeatmapBackgroundWithStoryboard); AddUntilStep("is storyboard background", () => getCurrentBackground() is BeatmapBackgroundWithStoryboard);
setSourceMode(BackgroundSource.Skin);
AddUntilStep("is skin background", () => getCurrentBackground() is SkinBackground);
} }
[Test] [Test]
@ -78,7 +81,7 @@ namespace osu.Game.Tests.Visual.Background
} }
private void setSourceMode(BackgroundSource source) => private void setSourceMode(BackgroundSource source) =>
AddStep("set background mode to beatmap", () => config.SetValue(OsuSetting.MenuBackgroundSource, source)); AddStep($"set background mode to {source}", () => config.SetValue(OsuSetting.MenuBackgroundSource, source));
private void setSupporter(bool isSupporter) => private void setSupporter(bool isSupporter) =>
AddStep($"set supporter {isSupporter}", () => ((DummyAPIAccess)API).LocalUser.Value = new User AddStep($"set supporter {isSupporter}", () => ((DummyAPIAccess)API).LocalUser.Value = new User