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

Fix test failure

This commit is contained in:
Dan Balasescu 2022-11-11 14:55:41 +09:00
parent fdca3c2d1c
commit 6ac19615fa
2 changed files with 15 additions and 1 deletions

View File

@ -55,6 +55,14 @@ namespace osu.Game.Tests.Chat
case MarkChannelAsReadRequest markRead:
handleMarkChannelAsReadRequest(markRead);
return true;
case GetUpdatesRequest updatesRequest:
updatesRequest.TriggerSuccess(new GetUpdatesResponse
{
Messages = sentMessages.ToList(),
Presence = new List<Channel>()
});
return true;
}
return false;
@ -95,6 +103,7 @@ namespace osu.Game.Tests.Chat
});
AddStep("post message", () => channelManager.PostMessage("Something interesting"));
AddUntilStep("message postesd", () => !channel.Messages.Any(m => m is LocalMessage));
AddStep("post /help command", () => channelManager.PostCommand("help", channel));
AddStep("post /me command with no action", () => channelManager.PostCommand("me", channel));
@ -115,7 +124,8 @@ namespace osu.Game.Tests.Chat
Content = request.Message.Content,
Links = request.Message.Links,
Timestamp = request.Message.Timestamp,
Sender = request.Message.Sender
Sender = request.Message.Sender,
Uuid = request.Message.Uuid
};
sentMessages.Add(message);

View File

@ -179,6 +179,10 @@ namespace osu.Game.Online.Chat
throw new InvalidOperationException("Attempted to add the same message again");
Messages.Add(final);
if (final.Id > LastMessageId)
LastMessageId = final.Id;
PendingMessageResolved?.Invoke(echo, final);
}