mirror of
https://github.com/ppy/osu
synced 2025-02-17 02:47:19 +00:00
Rename and expand chat tests
This commit is contained in:
parent
1e2f9d1ba1
commit
796afc0bf9
@ -11,7 +11,7 @@ namespace osu.Game.Tournament.Tests
|
||||
public class TestSceneGameplayScreen : OsuTestScene
|
||||
{
|
||||
[Cached]
|
||||
private MatchChatDisplay chat = new MatchChatDisplay();
|
||||
private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
|
@ -10,13 +10,13 @@ using osu.Game.Tournament.Components;
|
||||
using osu.Game.Tournament.IPC;
|
||||
using osu.Game.Tournament.Screens.Ladder.Components;
|
||||
using osu.Game.Users;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tournament.Tests
|
||||
{
|
||||
public class TestSceneMatchChatDisplay : OsuTestScene
|
||||
public class TestSceneTournamentMatchChatDisplay : OsuTestScene
|
||||
{
|
||||
private readonly Channel testChannel = new Channel();
|
||||
private readonly Channel testChannel2 = new Channel();
|
||||
|
||||
private readonly User admin = new User
|
||||
{
|
||||
@ -43,15 +43,14 @@ namespace osu.Game.Tournament.Tests
|
||||
[Cached]
|
||||
private MatchIPCInfo matchInfo = new MatchIPCInfo(); // hide parent
|
||||
|
||||
public TestSceneMatchChatDisplay()
|
||||
{
|
||||
MatchChatDisplay chatDisplay;
|
||||
private readonly TournamentMatchChatDisplay chatDisplay;
|
||||
|
||||
Add(chatDisplay = new MatchChatDisplay
|
||||
public TestSceneTournamentMatchChatDisplay()
|
||||
{
|
||||
Add(chatDisplay = new TournamentMatchChatDisplay
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
Size = new Vector2(400, 80)
|
||||
});
|
||||
|
||||
ladderInfo.CurrentMatch.Value = new MatchPairing
|
||||
@ -73,35 +72,59 @@ namespace osu.Game.Tournament.Tests
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
AddStep("message from admin", () => testChannel.AddLocalEcho(new LocalEchoMessage
|
||||
AddStep("message from admin", () => testChannel.AddNewMessages(new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I am a wang!"
|
||||
}));
|
||||
|
||||
AddStep("message from team red", () => testChannel.AddLocalEcho(new LocalEchoMessage
|
||||
AddStep("message from team red", () => testChannel.AddNewMessages(new Message(nextMessageId())
|
||||
{
|
||||
Sender = redUser,
|
||||
Content = "I am team red."
|
||||
}));
|
||||
|
||||
AddStep("message from team red", () => testChannel.AddLocalEcho(new LocalEchoMessage
|
||||
AddStep("message from team red", () => testChannel.AddNewMessages(new Message(nextMessageId())
|
||||
{
|
||||
Sender = redUser,
|
||||
Content = "I plan to win!"
|
||||
}));
|
||||
|
||||
AddStep("message from team blue", () => testChannel.AddLocalEcho(new LocalEchoMessage
|
||||
AddStep("message from team blue", () => testChannel.AddNewMessages(new Message(nextMessageId())
|
||||
{
|
||||
Sender = blueUser,
|
||||
Content = "Not on my watch. Prepare to eat saaaaaaaaaand. Lots and lots of saaaaaaand."
|
||||
}));
|
||||
|
||||
AddStep("message from admin", () => testChannel.AddLocalEcho(new LocalEchoMessage
|
||||
AddStep("message from admin", () => testChannel.AddNewMessages(new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "Okay okay, calm down guys. Let's do this!"
|
||||
}));
|
||||
|
||||
AddStep("multiple messages", () => testChannel.AddNewMessages(new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!"
|
||||
},
|
||||
new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!!!1"
|
||||
},
|
||||
new Message(nextMessageId())
|
||||
{
|
||||
Sender = admin,
|
||||
Content = "I spam you!1!1"
|
||||
}));
|
||||
|
||||
AddStep("change channel to 2", () => chatDisplay.Channel.Value = testChannel2);
|
||||
|
||||
AddStep("change channel to 1", () => chatDisplay.Channel.Value = testChannel);
|
||||
}
|
||||
|
||||
private int messageId;
|
||||
|
||||
private long? nextMessageId() => messageId++;
|
||||
}
|
||||
}
|
@ -13,13 +13,13 @@ using osuTK.Graphics;
|
||||
|
||||
namespace osu.Game.Tournament.Components
|
||||
{
|
||||
public class MatchChatDisplay : StandAloneChatDisplay
|
||||
public class TournamentMatchChatDisplay : StandAloneChatDisplay
|
||||
{
|
||||
private readonly Bindable<string> chatChannel = new Bindable<string>();
|
||||
|
||||
private ChannelManager manager;
|
||||
|
||||
public MatchChatDisplay()
|
||||
public TournamentMatchChatDisplay()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Y = 100;
|
@ -36,7 +36,7 @@ namespace osu.Game.Tournament.Screens.Gameplay
|
||||
private TournamentSceneManager sceneManager { get; set; }
|
||||
|
||||
[Resolved]
|
||||
private MatchChatDisplay chat { get; set; }
|
||||
private TournamentMatchChatDisplay chat { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(LadderInfo ladder, MatchIPCInfo ipc)
|
||||
|
@ -32,7 +32,7 @@ namespace osu.Game.Tournament.Screens
|
||||
private TourneyVideo video;
|
||||
|
||||
[Cached]
|
||||
private MatchChatDisplay chat = new MatchChatDisplay();
|
||||
private TournamentMatchChatDisplay chat = new TournamentMatchChatDisplay();
|
||||
|
||||
private Container chatContainer;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user