2019-10-10 09:06:25 +00:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using NUnit.Framework;
|
2020-01-27 11:58:27 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2019-10-10 09:06:25 +00:00
|
|
|
|
using osu.Framework.Bindables;
|
2020-01-27 11:58:27 +00:00
|
|
|
|
using osu.Game.Overlays;
|
2019-10-10 09:06:25 +00:00
|
|
|
|
using osu.Game.Overlays.Comments;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Online
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
|
|
|
|
public class TestSceneCommentsHeader : OsuTestScene
|
|
|
|
|
{
|
|
|
|
|
public override IReadOnlyList<Type> RequiredTypes => new[]
|
|
|
|
|
{
|
|
|
|
|
typeof(CommentsHeader),
|
|
|
|
|
typeof(HeaderButton),
|
2020-02-16 23:20:53 +00:00
|
|
|
|
typeof(OverlaySortTabControl<>),
|
2019-10-10 09:06:25 +00:00
|
|
|
|
};
|
|
|
|
|
|
2020-01-27 11:58:27 +00:00
|
|
|
|
[Cached]
|
|
|
|
|
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);
|
|
|
|
|
|
2019-10-10 12:56:08 +00:00
|
|
|
|
private readonly Bindable<CommentsSortCriteria> sort = new Bindable<CommentsSortCriteria>();
|
2019-10-10 09:06:25 +00:00
|
|
|
|
private readonly BindableBool showDeleted = new BindableBool();
|
|
|
|
|
|
|
|
|
|
public TestSceneCommentsHeader()
|
|
|
|
|
{
|
|
|
|
|
Add(new CommentsHeader
|
|
|
|
|
{
|
|
|
|
|
Sort = { BindTarget = sort },
|
|
|
|
|
ShowDeleted = { BindTarget = showDeleted }
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
AddStep("Trigger ShowDeleted", () => showDeleted.Value = !showDeleted.Value);
|
2019-10-10 12:56:08 +00:00
|
|
|
|
AddStep("Select old", () => sort.Value = CommentsSortCriteria.Old);
|
|
|
|
|
AddStep("Select new", () => sort.Value = CommentsSortCriteria.New);
|
|
|
|
|
AddStep("Select top", () => sort.Value = CommentsSortCriteria.Top);
|
2019-10-10 09:06:25 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|