mirror of
https://github.com/ppy/osu.git
synced 2024-09-21 21:27:24 +08:00
null check in test
This commit is contained in:
parent
8a06914438
commit
4c33013674
@ -1,11 +1,10 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
#nullable disable
|
|
||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
|
using osu.Framework.Extensions.ObjectExtensions;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Tournament.Components;
|
using osu.Game.Tournament.Components;
|
||||||
@ -16,7 +15,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
public partial class TestSceneMapPoolScreen : TournamentScreenTestScene
|
public partial class TestSceneMapPoolScreen : TournamentScreenTestScene
|
||||||
{
|
{
|
||||||
private MapPoolScreen screen;
|
private MapPoolScreen screen = null!;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
@ -32,7 +31,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
AddStep("load few maps", () =>
|
AddStep("load few maps", () =>
|
||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Clear();
|
Ladder.CurrentMatch.Value.AsNonNull().Round.Value.AsNonNull().Beatmaps.Clear();
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
addBeatmap();
|
addBeatmap();
|
||||||
@ -52,7 +51,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
AddStep("load just enough maps", () =>
|
AddStep("load just enough maps", () =>
|
||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Clear();
|
Ladder.CurrentMatch.Value.AsNonNull().Round.Value.AsNonNull().Beatmaps.Clear();
|
||||||
|
|
||||||
for (int i = 0; i < 18; i++)
|
for (int i = 0; i < 18; i++)
|
||||||
addBeatmap();
|
addBeatmap();
|
||||||
@ -72,7 +71,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
AddStep("load many maps", () =>
|
AddStep("load many maps", () =>
|
||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Clear();
|
Ladder.CurrentMatch.Value.AsNonNull().Round.Value.AsNonNull().Beatmaps.Clear();
|
||||||
|
|
||||||
for (int i = 0; i < 19; i++)
|
for (int i = 0; i < 19; i++)
|
||||||
addBeatmap();
|
addBeatmap();
|
||||||
@ -92,7 +91,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
AddStep("load many maps", () =>
|
AddStep("load many maps", () =>
|
||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Clear();
|
Ladder.CurrentMatch.Value.AsNonNull().Round.Value.AsNonNull().Beatmaps.Clear();
|
||||||
|
|
||||||
for (int i = 0; i < 11; i++)
|
for (int i = 0; i < 11; i++)
|
||||||
addBeatmap(i > 4 ? Ruleset.Value.CreateInstance().AllMods.ElementAt(i).Acronym : "NM");
|
addBeatmap(i > 4 ? Ruleset.Value.CreateInstance().AllMods.ElementAt(i).Acronym : "NM");
|
||||||
@ -118,7 +117,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
AddStep("load many maps", () =>
|
AddStep("load many maps", () =>
|
||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Clear();
|
Ladder.CurrentMatch.Value.AsNonNull().Round.Value.AsNonNull().Beatmaps.Clear();
|
||||||
|
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
addBeatmap(i > 4 ? Ruleset.Value.CreateInstance().AllMods.ElementAt(i).Acronym : "NM");
|
addBeatmap(i > 4 ? Ruleset.Value.CreateInstance().AllMods.ElementAt(i).Acronym : "NM");
|
||||||
@ -138,7 +137,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
{
|
{
|
||||||
AddStep("load many maps", () =>
|
AddStep("load many maps", () =>
|
||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Clear();
|
Ladder.CurrentMatch.Value.AsNonNull().Round.Value.AsNonNull().Beatmaps.Clear();
|
||||||
|
|
||||||
for (int i = 0; i < 12; i++)
|
for (int i = 0; i < 12; i++)
|
||||||
addBeatmap(i > 4 ? Ruleset.Value.CreateInstance().AllMods.ElementAt(i).Acronym : "NM");
|
addBeatmap(i > 4 ? Ruleset.Value.CreateInstance().AllMods.ElementAt(i).Acronym : "NM");
|
||||||
@ -155,7 +154,7 @@ namespace osu.Game.Tournament.Tests.Screens
|
|||||||
|
|
||||||
private void addBeatmap(string mods = "NM")
|
private void addBeatmap(string mods = "NM")
|
||||||
{
|
{
|
||||||
Ladder.CurrentMatch.Value.Round.Value.Beatmaps.Add(new RoundBeatmap
|
Ladder.CurrentMatch.Value.AsNonNull().Round.Value.AsNonNull().Beatmaps.Add(new RoundBeatmap
|
||||||
{
|
{
|
||||||
Beatmap = CreateSampleBeatmap(),
|
Beatmap = CreateSampleBeatmap(),
|
||||||
Mods = mods
|
Mods = mods
|
||||||
|
Loading…
Reference in New Issue
Block a user