mirror of
https://github.com/ppy/osu.git
synced 2024-12-13 08:32:57 +08:00
Add test
This commit is contained in:
parent
1b0fc8ca9d
commit
f3530a79b1
@ -378,6 +378,31 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
}, users);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAbortMatch()
|
||||
{
|
||||
multiplayerClient.Setup(m => m.StartMatch())
|
||||
.Callback(() =>
|
||||
{
|
||||
multiplayerClient.Raise(m => m.LoadRequested -= null);
|
||||
multiplayerClient.Object.Room!.State = MultiplayerRoomState.WaitingForLoad;
|
||||
|
||||
// The local user state doesn't really matter, so let's do the same as the base implementation for these tests.
|
||||
changeUserState(localUser.UserID, MultiplayerUserState.Idle);
|
||||
});
|
||||
|
||||
multiplayerClient.Setup(m => m.AbortMatch())
|
||||
.Callback(() =>
|
||||
{
|
||||
multiplayerClient.Object.Room!.State = MultiplayerRoomState.Open;
|
||||
raiseRoomUpdated();
|
||||
});
|
||||
|
||||
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
||||
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
||||
ClickButtonWhenEnabled<MultiplayerReadyButton>();
|
||||
}
|
||||
|
||||
private void verifyGameplayStartFlow()
|
||||
{
|
||||
checkLocalUserState(MultiplayerUserState.Ready);
|
||||
|
@ -396,10 +396,10 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public override Task AbortMatch()
|
||||
public override async Task AbortMatch()
|
||||
{
|
||||
// Todo:
|
||||
return Task.CompletedTask;
|
||||
ChangeUserState(api.LocalUser.Value.Id, MultiplayerUserState.Idle);
|
||||
await ((IMultiplayerClient)this).GameplayAborted(GameplayAbortReason.HostAbortedTheMatch).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public async Task AddUserPlaylistItem(int userId, MultiplayerPlaylistItem item)
|
||||
|
Loading…
Reference in New Issue
Block a user