mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Test coverage + no virtual
This commit is contained in:
@ -178,6 +178,48 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
.SingleOrDefault(panel => !panel.Filtered.Value)?.Mod is OsuModDoubleTime);
|
.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]
|
[Test]
|
||||||
public void TestNextPlaylistItemSelectedAfterCompletion()
|
public void TestNextPlaylistItemSelectedAfterCompletion()
|
||||||
{
|
{
|
||||||
|
@ -478,7 +478,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
|
|
||||||
public class UserModSelectButton : PurpleTriangleButton, IKeyBindingHandler<GlobalAction>
|
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)
|
if (e.Action == GlobalAction.ToggleModSelection && !e.Repeat)
|
||||||
{
|
{
|
||||||
@ -489,7 +489,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) { }
|
public void OnReleased(KeyBindingReleaseEvent<GlobalAction> e) { }
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
|
Reference in New Issue
Block a user