Make fields protected and expose them in tests

This commit is contained in:
iiSaLMaN
2019-06-26 22:42:34 +03:00
committed by KingLuigi4932
parent eaf6f6891d
commit 9ada4d68b1
7 changed files with 41 additions and 13 deletions

View File

@ -19,7 +19,7 @@ namespace osu.Game.Tests.Visual.Online
[TestFixture]
public class TestSceneBeatmapSetOverlay : OsuTestScene
{
private readonly BeatmapSetOverlay overlay;
private readonly TestBeatmapSetOverlay overlay;
public override IReadOnlyList<Type> RequiredTypes => new[]
{
@ -47,7 +47,7 @@ namespace osu.Game.Tests.Visual.Online
public TestSceneBeatmapSetOverlay()
{
Add(overlay = new BeatmapSetOverlay());
Add(overlay = new TestBeatmapSetOverlay());
}
[BackgroundDependencyLoader]
@ -435,7 +435,12 @@ namespace osu.Game.Tests.Visual.Online
private void downloadAssert(bool shown)
{
AddAssert($"is download button {(shown ? "shown" : "hidden")}", () => overlay.Header.DownloadButtonsContainer.Any() == shown);
AddAssert($"is download button {(shown ? "shown" : "hidden")}", () => overlay.IsDownloadButtonsShown == shown);
}
private class TestBeatmapSetOverlay : BeatmapSetOverlay
{
public bool IsDownloadButtonsShown => Header.DownloadButtonsContainer.Any();
}
}
}