mirror of
https://github.com/osukey/osukey.git
synced 2025-05-18 20:17:23 +09:00
Add test coverage of spectator requests
This commit is contained in:
parent
6a61fd95eb
commit
09d560c93e
@ -84,6 +84,8 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
[SetUpSteps]
|
[SetUpSteps]
|
||||||
public virtual void SetUpSteps()
|
public virtual void SetUpSteps()
|
||||||
{
|
{
|
||||||
|
AddStep("reset counts", () => spectatorClient.Invocations.Clear());
|
||||||
|
|
||||||
AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = new APIUser
|
AddStep("set local user", () => ((DummyAPIAccess)API).LocalUser.Value = new APIUser
|
||||||
{
|
{
|
||||||
Id = 1,
|
Id = 1,
|
||||||
@ -111,6 +113,12 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
});
|
});
|
||||||
|
|
||||||
AddUntilStep("wait for load", () => Leaderboard.IsLoaded);
|
AddUntilStep("wait for load", () => Leaderboard.IsLoaded);
|
||||||
|
|
||||||
|
AddStep("check watch requests were sent", () =>
|
||||||
|
{
|
||||||
|
foreach (var user in MultiplayerUsers)
|
||||||
|
spectatorClient.Verify(s => s.WatchUser(user.UserID), Times.Once);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@ -131,6 +139,12 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
|||||||
MultiplayerUsers.RemoveAt(0);
|
MultiplayerUsers.RemoveAt(0);
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
AddStep("check stop watching requests were sent", () =>
|
||||||
|
{
|
||||||
|
foreach (var user in MultiplayerUsers)
|
||||||
|
spectatorClient.Verify(s => s.StopWatchingUser(user.UserID), Times.Once);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
|
@ -221,7 +221,7 @@ namespace osu.Game.Online.Spectator
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WatchUser(int userId)
|
public virtual void WatchUser(int userId)
|
||||||
{
|
{
|
||||||
Debug.Assert(ThreadSafety.IsUpdateThread);
|
Debug.Assert(ThreadSafety.IsUpdateThread);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user