Skip to content

Commit

Permalink
Fix regressed screen test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
peppy committed Feb 15, 2019
1 parent 31bbefb commit 65721a0
Showing 9 changed files with 26 additions and 28 deletions.
15 changes: 2 additions & 13 deletions osu.Game.Tests/Visual/TestCaseDisclaimer.cs
Original file line number Diff line number Diff line change
@@ -2,27 +2,16 @@
// See the LICENCE file in the repository root for full licence text.

using osu.Framework.Allocation;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Shapes;
using osu.Game.Screens.Menu;
using osuTK.Graphics;

namespace osu.Game.Tests.Visual
{
public class TestCaseDisclaimer : OsuTestCase
public class TestCaseDisclaimer : ScreenTestCase
{
[BackgroundDependencyLoader]
private void load()
{
Children = new Drawable[]
{
new Box
{
RelativeSizeAxes = Axes.Both,
Colour = Color4.Black,
},
new Disclaimer()
};
LoadScreen(new Disclaimer());
}
}
}
4 changes: 2 additions & 2 deletions osu.Game.Tests/Visual/TestCaseDrawings.cs
Original file line number Diff line number Diff line change
@@ -9,11 +9,11 @@
namespace osu.Game.Tests.Visual
{
[Description("for tournament use")]
public class TestCaseDrawings : OsuTestCase
public class TestCaseDrawings : ScreenTestCase
{
public TestCaseDrawings()
{
Add(new Drawings
LoadScreen(new Drawings
{
TeamList = new TestTeamList(),
});
4 changes: 2 additions & 2 deletions osu.Game.Tests/Visual/TestCaseMatchResults.cs
Original file line number Diff line number Diff line change
@@ -40,10 +40,10 @@ private void load()
Room.RoomID.Value = 1;
Room.Name.Value = "an awesome room";

Child = new TestMatchResults(new ScoreInfo
LoadScreen(new TestMatchResults(new ScoreInfo
{
User = new User { Id = 10 },
});
}));
}

private class TestMatchResults : MatchResults
4 changes: 2 additions & 2 deletions osu.Game.Tests/Visual/TestCaseMultiScreen.cs
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseMultiScreen : OsuTestCase
public class TestCaseMultiScreen : ScreenTestCase
{
public override IReadOnlyList<Type> RequiredTypes => new[]
{
@@ -25,7 +25,7 @@ public TestCaseMultiScreen()
{
Multiplayer multi = new Multiplayer();

AddStep(@"show", () => Add(multi));
AddStep(@"show", () => LoadScreen(multi));
AddWaitStep(5);
AddStep(@"exit", multi.Exit);
}
7 changes: 6 additions & 1 deletion osu.Game.Tests/Visual/TestCaseParallaxContainer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// 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 osu.Framework.Graphics;
using osu.Framework.Screens;
using osu.Game.Graphics.Containers;
using osu.Game.Screens.Backgrounds;

@@ -14,7 +16,10 @@ public TestCaseParallaxContainer()

Add(parallax = new ParallaxContainer
{
Child = new BackgroundScreenDefault { Alpha = 0.8f }
Child = new ScreenStack(new BackgroundScreenDefault { Alpha = 0.8f })
{
RelativeSizeAxes = Axes.Both,
}
});

AddStep("default parallax", () => parallax.ParallaxAmount = ParallaxContainer.DEFAULT_PARALLAX_AMOUNT);
6 changes: 4 additions & 2 deletions osu.Game.Tests/Visual/TestCasePlaySongSelect.cs
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
using osu.Framework.Extensions;
using osu.Framework.MathUtils;
using osu.Framework.Platform;
using osu.Framework.Screens;
using osu.Game.Beatmaps;
using osu.Game.Database;
using osu.Game.Rulesets;
@@ -25,7 +26,7 @@
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCasePlaySongSelect : OsuTestCase
public class TestCasePlaySongSelect : ScreenTestCase
{
private BeatmapManager manager;

@@ -107,7 +108,8 @@ public virtual void SetUp()
Schedule(() =>
{
manager?.Delete(manager.GetAllUsableBeatmapSets());
Child = songSelect = new TestSongSelect();
LoadScreen(songSelect = new TestSongSelect());
AddUntilStep(() => songSelect.IsPresent, "wait for present");
});
}

4 changes: 2 additions & 2 deletions osu.Game.Tests/Visual/TestCaseResults.cs
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@
namespace osu.Game.Tests.Visual
{
[TestFixture]
public class TestCaseResults : OsuTestCase
public class TestCaseResults : ScreenTestCase
{
private BeatmapManager beatmaps;

@@ -43,7 +43,7 @@ protected override void LoadComplete()
if (beatmapInfo != null)
Beatmap.Value = beatmaps.GetWorkingBeatmap(beatmapInfo);

Add(new SoloResults(new ScoreInfo
LoadScreen(new SoloResults(new ScoreInfo
{
TotalScore = 2845370,
Accuracy = 0.98,
8 changes: 5 additions & 3 deletions osu.Game/Tests/OsuTestBrowser.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// 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 osu.Framework.Graphics;
using osu.Framework.Platform;
using osu.Framework.Screens;
using osu.Framework.Testing;
using osu.Game.Graphics;
using osu.Game.Screens.Backgrounds;
@@ -14,10 +16,10 @@ protected override void LoadComplete()
{
base.LoadComplete();

LoadComponentAsync(new BackgroundScreenDefault
LoadComponentAsync(new ScreenStack(new BackgroundScreenDefault { Colour = OsuColour.Gray(0.5f) })
{
Colour = OsuColour.Gray(0.5f),
Depth = 10
Depth = 10,
RelativeSizeAxes = Axes.Both,
}, AddInternal);

// Have to construct this here, rather than in the constructor, because
2 changes: 1 addition & 1 deletion osu.Game/Tests/Visual/MultiplayerTestCase.cs
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

namespace osu.Game.Tests.Visual
{
public abstract class MultiplayerTestCase : OsuTestCase
public abstract class MultiplayerTestCase : ScreenTestCase
{
[Cached]
private readonly Bindable<Room> currentRoom = new Bindable<Room>(new Room());

0 comments on commit 65721a0

Please sign in to comment.