mirror of
https://github.com/ppy/osu.git
synced 2025-01-27 15:33:21 +08:00
Merge branch 'master' into new-multiplayer-playlist
This commit is contained in:
commit
c00684a2f7
@ -16,6 +16,27 @@ namespace osu.Game.Tests.NonVisual.Multiplayer
|
|||||||
[HeadlessTest]
|
[HeadlessTest]
|
||||||
public class StatefulMultiplayerClientTest : MultiplayerTestScene
|
public class StatefulMultiplayerClientTest : MultiplayerTestScene
|
||||||
{
|
{
|
||||||
|
[Test]
|
||||||
|
public void TestUserAddedOnJoin()
|
||||||
|
{
|
||||||
|
var user = new APIUser { Id = 33 };
|
||||||
|
|
||||||
|
AddRepeatStep("add user multiple times", () => Client.AddUser(user), 3);
|
||||||
|
AddAssert("room has 2 users", () => Client.Room?.Users.Count == 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestUserRemovedOnLeave()
|
||||||
|
{
|
||||||
|
var user = new APIUser { Id = 44 };
|
||||||
|
|
||||||
|
AddStep("add user", () => Client.AddUser(user));
|
||||||
|
AddAssert("room has 2 users", () => Client.Room?.Users.Count == 2);
|
||||||
|
|
||||||
|
AddRepeatStep("remove user multiple times", () => Client.RemoveUser(user), 3);
|
||||||
|
AddAssert("room has 1 user", () => Client.Room?.Users.Count == 1);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestPlayingUserTracking()
|
public void TestPlayingUserTracking()
|
||||||
{
|
{
|
||||||
|
@ -1,35 +0,0 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
|
||||||
|
|
||||||
using NUnit.Framework;
|
|
||||||
using osu.Framework.Testing;
|
|
||||||
using osu.Game.Online.API.Requests.Responses;
|
|
||||||
using osu.Game.Tests.Visual.Multiplayer;
|
|
||||||
|
|
||||||
namespace osu.Game.Tests.OnlinePlay
|
|
||||||
{
|
|
||||||
[HeadlessTest]
|
|
||||||
public class StatefulMultiplayerClientTest : MultiplayerTestScene
|
|
||||||
{
|
|
||||||
[Test]
|
|
||||||
public void TestUserAddedOnJoin()
|
|
||||||
{
|
|
||||||
var user = new APIUser { Id = 33 };
|
|
||||||
|
|
||||||
AddRepeatStep("add user multiple times", () => Client.AddUser(user), 3);
|
|
||||||
AddAssert("room has 2 users", () => Client.Room?.Users.Count == 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void TestUserRemovedOnLeave()
|
|
||||||
{
|
|
||||||
var user = new APIUser { Id = 44 };
|
|
||||||
|
|
||||||
AddStep("add user", () => Client.AddUser(user));
|
|
||||||
AddAssert("room has 2 users", () => Client.Room?.Users.Count == 2);
|
|
||||||
|
|
||||||
AddRepeatStep("remove user multiple times", () => Client.RemoveUser(user), 3);
|
|
||||||
AddAssert("room has 1 user", () => Client.Room?.Users.Count == 1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -25,9 +25,9 @@ namespace osu.Game.Tests.Visual.OnlinePlay
|
|||||||
|
|
||||||
private readonly List<Room> serverSideRooms = new List<Room>();
|
private readonly List<Room> serverSideRooms = new List<Room>();
|
||||||
|
|
||||||
private int currentRoomId;
|
private int currentRoomId = 1;
|
||||||
private int currentPlaylistItemId;
|
private int currentPlaylistItemId = 1;
|
||||||
private int currentScoreId;
|
private int currentScoreId = 1;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Handles an API request, while also updating the local state to match
|
/// Handles an API request, while also updating the local state to match
|
||||||
|
Loading…
Reference in New Issue
Block a user