From f3f3d1d0fc96ec45a78f99b0c7b5c5fbbf642422 Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Thu, 7 Dec 2017 11:11:43 +0100 Subject: [PATCH] Various test fixes --- osu.Game.Tests/Visual/TestCaseChatLink.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseChatLink.cs b/osu.Game.Tests/Visual/TestCaseChatLink.cs index a2e73a56fb..a37d431760 100644 --- a/osu.Game.Tests/Visual/TestCaseChatLink.cs +++ b/osu.Game.Tests/Visual/TestCaseChatLink.cs @@ -17,7 +17,7 @@ namespace osu.Game.Tests.Visual private DependencyContainer dependencies; - private readonly ChatLineContainer textContainer; + private readonly TestChatLineContainer textContainer; private ChatLine[] testSprites; protected override IReadOnlyDependencyContainer CreateLocalDependencies(IReadOnlyDependencyContainer parent) => dependencies = new DependencyContainer(parent); @@ -25,9 +25,9 @@ namespace osu.Game.Tests.Visual public TestCaseChatLink() { chat = new ChatOverlay(); - Add(beatmapSetOverlay = new BeatmapSetOverlay { Depth = float.MaxValue }); + Add(beatmapSetOverlay = new BeatmapSetOverlay { Depth = float.MinValue }); - Add(textContainer = new ChatLineContainer + Add(textContainer = new TestChatLineContainer { Padding = new MarginPadding { Left = 20, Right = 20 }, RelativeSizeAxes = Axes.X, @@ -39,11 +39,15 @@ namespace osu.Game.Tests.Visual { new ChatLine(new DummyMessage("Test!")), new ChatLine(new DummyMessage("osu.ppy.sh!")), - new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")), + new ChatLine(new DummyMessage("http://lookatmy.horse/")), new ChatLine(new DummyMessage("https://osu.ppy.sh!")), new ChatLine(new DummyMessage("00:12:345 (1,2) - Test?")), + // TODO: Remove prefix and add tooltips with links new ChatLine(new DummyMessage("Wiki link for tasty [[Performance Points]]")), - new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true)), + new ChatLine(new DummyMessage("(osu forums)[https://osu.ppy.sh/forum] (old link format)")), + new ChatLine(new DummyMessage("[https://osu.ppy.sh/home New site] (new link format)")), + new ChatLine(new DummyMessage("long message to test word wrap: use https://encrypted.google.com instead of https://google.com or even worse, [http://google.com Unencrypted google]")), + new ChatLine(new DummyMessage("is now listening to [https://osu.ppy.sh/s/93523 IMAGE -MATERIAL- ]", true)), new ChatLine(new DummyMessage("is now playing [https://osu.ppy.sh/b/252238 IMAGE -MATERIAL- ]", true)), }; } @@ -86,7 +90,6 @@ namespace osu.Game.Tests.Visual public new long Id = 42; public new TargetType TargetType = TargetType.Channel; public new int TargetId = 1; - public new bool IsAction; public new DateTimeOffset Timestamp = DateTimeOffset.Now; public DummyMessage(string text, bool isAction = false) @@ -98,7 +101,7 @@ namespace osu.Game.Tests.Visual } } - private class ChatLineContainer : FillFlowContainer + private class TestChatLineContainer : FillFlowContainer { protected override int Compare(Drawable x, Drawable y) {