mirror of
https://github.com/ppy/osu.git
synced 2025-03-15 15:27:20 +08:00
Test coverage + no virtual
This commit is contained in:
parent
2bd4c126d3
commit
fc25d248ad
@ -178,6 +178,48 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
.SingleOrDefault(panel => !panel.Filtered.Value)?.Mod is OsuModDoubleTime);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestModSelectKeyWithAllowedMods()
|
||||
{
|
||||
AddStep("add playlist item with allowed mod", () =>
|
||||
{
|
||||
SelectedRoom.Value.Playlist.Add(new PlaylistItem(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo)
|
||||
{
|
||||
RulesetID = new OsuRuleset().RulesetInfo.OnlineID,
|
||||
AllowedMods = new[] { new APIMod(new OsuModDoubleTime()) }
|
||||
});
|
||||
});
|
||||
|
||||
ClickButtonWhenEnabled<MultiplayerMatchSettingsOverlay.CreateOrUpdateButton>();
|
||||
|
||||
AddUntilStep("wait for join", () => RoomJoined);
|
||||
|
||||
AddStep("press toggle mod select key", () => InputManager.Key(osuTK.Input.Key.F1));
|
||||
|
||||
AddUntilStep("mod select contents loaded",
|
||||
() => this.ChildrenOfType<ModColumn>().Any() && this.ChildrenOfType<ModColumn>().All(col => col.IsLoaded && col.ItemsLoaded));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestModSelectKeyWithNoAllowedMods()
|
||||
{
|
||||
AddStep("add playlist item with no allowed mods", () =>
|
||||
{
|
||||
SelectedRoom.Value.Playlist.Add(new PlaylistItem(new TestBeatmap(new OsuRuleset().RulesetInfo).BeatmapInfo)
|
||||
{
|
||||
RulesetID = new OsuRuleset().RulesetInfo.OnlineID,
|
||||
});
|
||||
});
|
||||
ClickButtonWhenEnabled<MultiplayerMatchSettingsOverlay.CreateOrUpdateButton>();
|
||||
|
||||
AddUntilStep("wait for join", () => RoomJoined);
|
||||
|
||||
AddStep("press toggle mod select key", () => InputManager.Key(osuTK.Input.Key.F1));
|
||||
|
||||
AddAssert("mod select contents not loaded",
|
||||
() => !(this.ChildrenOfType<ModColumn>().Any() && this.ChildrenOfType<ModColumn>().All(col => col.IsLoaded && col.ItemsLoaded)));
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNextPlaylistItemSelectedAfterCompletion()
|
||||
{
|
||||
|
@ -478,7 +478,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
||||
|
||||
public class UserModSelectButton : PurpleTriangleButton, IKeyBindingHandler<GlobalAction>
|
||||
{
|
||||
public virtual bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
public bool OnPressed(KeyBindingPressEvent<GlobalAction> e)
|
||||
{
|
||||
if (e.Action == GlobalAction.ToggleModSelection && !e.Repeat)
|
||||
{
|
||||
@ -489,7 +489,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) { }
|
||||
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) { }
|
||||
}
|
||||
|
||||
protected override void Dispose(bool isDisposing)
|
||||
|
Loading…
x
Reference in New Issue
Block a user