1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 17:32:54 +08:00

Add request handler for dummy API

This commit is contained in:
Craftplacer 2021-06-05 11:10:16 +02:00
parent b746fe7c03
commit 6e40af756b
No known key found for this signature in database
GPG Key ID: 0D94BDA3F64B90CE

View File

@ -8,6 +8,7 @@ using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Testing;
using osu.Game.Online.API;
using osu.Game.Online.Chat;
using osu.Game.Overlays;
using osu.Game.Overlays.Notifications;
@ -28,6 +29,14 @@ namespace osu.Game.Tests.Visual.Online
[SetUp]
public void Setup()
{
// We blindly mark every request as success so that ChannelManager doesn't remove our channel again.
if (API is DummyAPIAccess daa)
{
daa.HandleRequest = (request) => {
return true;
};
}
friend = new User { Id = 0, Username = "Friend" };
publicChannel = new Channel { Id = 1, Name = "osu" };
privateMessageChannel = new Channel(friend) { Id = 2, Name = friend.Username, Type = ChannelType.PM };