mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Update various tests to enable NRT to avoid new inspection failures
This commit is contained in:
@ -1,8 +1,6 @@
|
||||
// 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.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@ -33,20 +31,21 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
public class TestSceneMultiSpectatorScreen : MultiplayerTestScene
|
||||
{
|
||||
[Resolved]
|
||||
private OsuGameBase game { get; set; }
|
||||
private OsuGameBase game { get; set; } = null!;
|
||||
|
||||
[Resolved]
|
||||
private OsuConfigManager config { get; set; }
|
||||
private OsuConfigManager config { get; set; } = null!;
|
||||
|
||||
[Resolved]
|
||||
private BeatmapManager beatmapManager { get; set; }
|
||||
private BeatmapManager beatmapManager { get; set; } = null!;
|
||||
|
||||
private MultiSpectatorScreen spectatorScreen;
|
||||
private MultiSpectatorScreen spectatorScreen = null!;
|
||||
|
||||
private readonly List<MultiplayerRoomUser> playingUsers = new List<MultiplayerRoomUser>();
|
||||
|
||||
private BeatmapSetInfo importedSet;
|
||||
private BeatmapInfo importedBeatmap;
|
||||
private BeatmapSetInfo importedSet = null!;
|
||||
private BeatmapInfo importedBeatmap = null!;
|
||||
|
||||
private int importedBeatmapId;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -340,7 +339,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
sendFrames(getPlayerIds(count), 300);
|
||||
}
|
||||
|
||||
Player player = null;
|
||||
Player? player = null;
|
||||
|
||||
AddStep($"get {PLAYER_1_ID} player instance", () => player = getInstance(PLAYER_1_ID).ChildrenOfType<Player>().Single());
|
||||
|
||||
@ -369,7 +368,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
b.Storyboard.GetLayer("Background").Add(sprite);
|
||||
});
|
||||
|
||||
private void testLeadIn(Action<WorkingBeatmap> applyToBeatmap = null)
|
||||
private void testLeadIn(Action<WorkingBeatmap>? applyToBeatmap = null)
|
||||
{
|
||||
start(PLAYER_1_ID);
|
||||
|
||||
@ -387,7 +386,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
assertRunning(PLAYER_1_ID);
|
||||
}
|
||||
|
||||
private void loadSpectateScreen(bool waitForPlayerLoad = true, Action<WorkingBeatmap> applyToBeatmap = null)
|
||||
private void loadSpectateScreen(bool waitForPlayerLoad = true, Action<WorkingBeatmap>? applyToBeatmap = null)
|
||||
{
|
||||
AddStep("load screen", () =>
|
||||
{
|
||||
|
@ -1,8 +1,6 @@
|
||||
// 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.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
@ -51,17 +49,17 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
{
|
||||
public class TestSceneMultiplayer : ScreenTestScene
|
||||
{
|
||||
private BeatmapManager beatmaps;
|
||||
private RulesetStore rulesets;
|
||||
private BeatmapSetInfo importedSet;
|
||||
private BeatmapManager beatmaps = null!;
|
||||
private RulesetStore rulesets = null!;
|
||||
private BeatmapSetInfo importedSet = null!;
|
||||
|
||||
private TestMultiplayerComponents multiplayerComponents;
|
||||
private TestMultiplayerComponents multiplayerComponents = null!;
|
||||
|
||||
private TestMultiplayerClient multiplayerClient => multiplayerComponents.MultiplayerClient;
|
||||
private TestMultiplayerRoomManager roomManager => multiplayerComponents.RoomManager;
|
||||
|
||||
[Resolved]
|
||||
private OsuConfigManager config { get; set; }
|
||||
private OsuConfigManager config { get; set; } = null!;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(GameHost host, AudioManager audio)
|
||||
@ -146,7 +144,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
private void removeLastUser()
|
||||
{
|
||||
APIUser lastUser = multiplayerClient.ServerRoom?.Users.Last().User;
|
||||
APIUser? lastUser = multiplayerClient.ServerRoom?.Users.Last().User;
|
||||
|
||||
if (lastUser == null || lastUser == multiplayerClient.LocalUser?.User)
|
||||
return;
|
||||
@ -156,7 +154,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
private void kickLastUser()
|
||||
{
|
||||
APIUser lastUser = multiplayerClient.ServerRoom?.Users.Last().User;
|
||||
APIUser? lastUser = multiplayerClient.ServerRoom?.Users.Last().User;
|
||||
|
||||
if (lastUser == null || lastUser == multiplayerClient.LocalUser?.User)
|
||||
return;
|
||||
@ -351,7 +349,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
AddStep("select room", () => InputManager.Key(Key.Down));
|
||||
AddStep("join room", () => InputManager.Key(Key.Enter));
|
||||
|
||||
DrawableLoungeRoom.PasswordEntryPopover passwordEntryPopover = null;
|
||||
DrawableLoungeRoom.PasswordEntryPopover? passwordEntryPopover = null;
|
||||
AddUntilStep("password prompt appeared", () => (passwordEntryPopover = InputManager.ChildrenOfType<DrawableLoungeRoom.PasswordEntryPopover>().FirstOrDefault()) != null);
|
||||
AddStep("enter password in text box", () => passwordEntryPopover.ChildrenOfType<TextBox>().First().Text = "password");
|
||||
AddStep("press join room button", () => passwordEntryPopover.ChildrenOfType<OsuButton>().First().TriggerClick());
|
||||
@ -678,7 +676,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestGameplayExitFlow()
|
||||
{
|
||||
Bindable<double> holdDelay = null;
|
||||
Bindable<double>? holdDelay = null;
|
||||
|
||||
AddStep("Set hold delay to zero", () =>
|
||||
{
|
||||
@ -709,7 +707,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
AddUntilStep("wait for lounge", () => multiplayerComponents.CurrentScreen is Screens.OnlinePlay.Multiplayer.Multiplayer);
|
||||
|
||||
AddStep("stop holding", () => InputManager.ReleaseKey(Key.Escape));
|
||||
AddStep("set hold delay to default", () => holdDelay.SetDefault());
|
||||
AddStep("set hold delay to default", () => holdDelay?.SetDefault());
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -992,7 +990,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
AddUntilStep("wait for ready button to be enabled", () => readyButton.Enabled.Value);
|
||||
|
||||
MultiplayerUserState lastState = MultiplayerUserState.Idle;
|
||||
MultiplayerRoomUser user = null;
|
||||
MultiplayerRoomUser? user = null;
|
||||
|
||||
AddStep("click ready button", () =>
|
||||
{
|
||||
|
@ -1,8 +1,6 @@
|
||||
// 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.
|
||||
|
||||
#nullable disable
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using NUnit.Framework;
|
||||
@ -66,7 +64,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
[Test]
|
||||
public void TestRemoveUser()
|
||||
{
|
||||
APIUser secondUser = null;
|
||||
APIUser? secondUser = null;
|
||||
|
||||
AddStep("add a user", () =>
|
||||
{
|
||||
@ -80,7 +78,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
AddStep("remove host", () => MultiplayerClient.RemoveUser(API.LocalUser.Value));
|
||||
|
||||
AddAssert("single panel is for second user", () => this.ChildrenOfType<ParticipantPanel>().Single().User.UserID == secondUser.Id);
|
||||
AddAssert("single panel is for second user", () => this.ChildrenOfType<ParticipantPanel>().Single().User.UserID == secondUser?.Id);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@ -368,7 +366,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
|
||||
private void createNewParticipantsList()
|
||||
{
|
||||
ParticipantsList participantsList = null;
|
||||
ParticipantsList? participantsList = null;
|
||||
|
||||
AddStep("create new list", () => Child = participantsList = new ParticipantsList
|
||||
{
|
||||
@ -378,7 +376,7 @@ namespace osu.Game.Tests.Visual.Multiplayer
|
||||
Size = new Vector2(380, 0.7f)
|
||||
});
|
||||
|
||||
AddUntilStep("wait for list to load", () => participantsList.IsLoaded);
|
||||
AddUntilStep("wait for list to load", () => participantsList?.IsLoaded == true);
|
||||
}
|
||||
|
||||
private void checkProgressBarVisibility(bool visible) =>
|
||||
|
Reference in New Issue
Block a user