2022-04-04 01:53:05 +08: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.
|
|
|
|
|
2022-04-17 22:54:30 +08:00
|
|
|
using System.Linq;
|
2022-04-04 01:53:05 +08:00
|
|
|
using NUnit.Framework;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2022-04-17 22:54:30 +08:00
|
|
|
using osu.Framework.Testing;
|
|
|
|
using osu.Game.Overlays.Mods;
|
2022-04-04 01:53:05 +08:00
|
|
|
using osu.Game.Screens.OnlinePlay;
|
|
|
|
|
|
|
|
namespace osu.Game.Tests.Visual.Multiplayer
|
|
|
|
{
|
|
|
|
public class TestSceneFreeModSelectScreen : MultiplayerTestScene
|
|
|
|
{
|
|
|
|
[Test]
|
|
|
|
public void TestFreeModSelect()
|
|
|
|
{
|
|
|
|
FreeModSelectScreen freeModSelectScreen = null;
|
|
|
|
|
|
|
|
AddStep("create free mod select screen", () => Child = freeModSelectScreen = new FreeModSelectScreen
|
|
|
|
{
|
|
|
|
State = { Value = Visibility.Visible }
|
|
|
|
});
|
2022-04-17 22:54:30 +08:00
|
|
|
|
|
|
|
AddAssert("all visible mods are playable",
|
|
|
|
() => this.ChildrenOfType<ModPanel>()
|
|
|
|
.Where(panel => panel.IsPresent)
|
|
|
|
.All(panel => panel.Mod.HasImplementation && panel.Mod.UserPlayable));
|
|
|
|
|
2022-04-04 01:53:05 +08:00
|
|
|
AddToggleStep("toggle visibility", visible =>
|
|
|
|
{
|
|
|
|
if (freeModSelectScreen != null)
|
|
|
|
freeModSelectScreen.State.Value = visible ? Visibility.Visible : Visibility.Hidden;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|