mirror of
https://github.com/ppy/osu
synced 2025-01-22 13:53:30 +00:00
Test scene for BeatmapNotAvailable
This commit is contained in:
parent
130ff56886
commit
13cd22e397
54
osu.Game.Tests/Visual/Online/TestSceneBeatmapNotAvailable.cs
Normal file
54
osu.Game.Tests/Visual/Online/TestSceneBeatmapNotAvailable.cs
Normal file
@ -0,0 +1,54 @@
|
||||
// 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 NUnit.Framework;
|
||||
using osu.Game.Beatmaps;
|
||||
using osu.Game.Overlays.BeatmapSet;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
[TestFixture]
|
||||
public class TestSceneBeatmapNotAvailable : OsuTestScene
|
||||
{
|
||||
public TestSceneBeatmapNotAvailable()
|
||||
{
|
||||
var container = new BeatmapNotAvailable();
|
||||
|
||||
Add(container);
|
||||
|
||||
AddAssert("is container hidden", () => container.Alpha == 0);
|
||||
AddStep("set undownloadable beatmapset", () => container.BeatmapSet = new BeatmapSetInfo
|
||||
{
|
||||
OnlineInfo = new BeatmapSetOnlineInfo
|
||||
{
|
||||
Availability = new BeatmapSetOnlineAvailability
|
||||
{
|
||||
DownloadDisabled = true,
|
||||
ExternalLink = @"https://gist.githubusercontent.com/peppy/99e6959772083cdfde8a/raw",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
AddAssert("is container visible", () => container.Alpha == 1);
|
||||
AddStep("set downloadable beatmapset", () => container.BeatmapSet = new BeatmapSetInfo
|
||||
{
|
||||
OnlineInfo = new BeatmapSetOnlineInfo
|
||||
{
|
||||
Availability = new BeatmapSetOnlineAvailability
|
||||
{
|
||||
DownloadDisabled = false,
|
||||
ExternalLink = @"https://gist.githubusercontent.com/peppy/99e6959772083cdfde8a/raw",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
AddAssert("is container still visible", () => container.Alpha == 1);
|
||||
AddStep("set normal beatmapset", () => container.BeatmapSet = new BeatmapSetInfo
|
||||
{
|
||||
OnlineInfo = new BeatmapSetOnlineInfo(),
|
||||
});
|
||||
|
||||
AddAssert("is container hidden", () => container.Alpha == 0);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user