1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-17 07:13:59 +08:00
Files
osu-lazer/osu.Game.Tests/Visual/SongSelectV2/TestScenePanelUpdateBeatmapButton.cs
T
Dean Herbert 0aff50fbf5 Rename song select v2 classes and namespaces
This aims to bring some conformity to naming to make it easier to
understand component structure for new components.

Renames are pulled out of the song select v2 changes and are more
relevant there due to many new classes being added.

- `V2` suffix is dropped, with v2 components being moved to a relevant V2 namespace.
- Related classes have a prefix of the area they are used.
- Experimenting with using partial/nested classes in the song select v2 implementation.
  Not committing to this yet but want to see how it plays out.
- Moved base carousel components to a generic namespace to avoid confusion with actual beatmap carousel implementation.
2025-04-16 18:34:53 +09:00

63 lines
1.8 KiB
C#

// 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 NUnit.Framework;
using osu.Framework.Graphics;
using osu.Game.Beatmaps;
using osu.Game.Screens.SelectV2;
namespace osu.Game.Tests.Visual.SongSelectV2
{
public partial class TestScenePanelUpdateBeatmapButton : OsuTestScene
{
private PanelUpdateBeatmapButton button = null!;
[SetUp]
public void SetUp() => Schedule(() =>
{
Child = button = new PanelUpdateBeatmapButton
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
};
});
[Test]
public void TestNullBeatmap()
{
AddStep("null beatmap", () => button.BeatmapSet = null);
AddAssert("button invisible", () => button.Alpha == 0f);
}
[Test]
public void TestUpdatedBeatmap()
{
AddStep("updated beatmap", () => button.BeatmapSet = new BeatmapSetInfo
{
Beatmaps = { new BeatmapInfo() }
});
AddAssert("button invisible", () => button.Alpha == 0f);
}
[Test]
public void TestNonUpdatedBeatmap()
{
AddStep("non-updated beatmap", () => button.BeatmapSet = new BeatmapSetInfo
{
Beatmaps =
{
new BeatmapInfo
{
MD5Hash = "test",
OnlineMD5Hash = "online",
LastOnlineUpdate = DateTimeOffset.Now,
}
}
});
AddAssert("button visible", () => button.Alpha == 1f);
}
}
}