Merge branch 'master' into fix_progress_bar_info

This commit is contained in:
Dean Herbert
2022-09-02 18:00:35 +09:00
committed by GitHub
147 changed files with 2718 additions and 1303 deletions

View File

@ -73,7 +73,7 @@ namespace osu.Game.Tests.Visual.UserInterface
dependencies.Cache(new RealmRulesetStore(Realm));
dependencies.Cache(beatmapManager = new BeatmapManager(LocalStorage, Realm, null, dependencies.Get<AudioManager>(), Resources, dependencies.Get<GameHost>(), Beatmap.Default));
dependencies.Cache(scoreManager = new ScoreManager(dependencies.Get<RulesetStore>(), () => beatmapManager, LocalStorage, Realm, Scheduler, API));
dependencies.Cache(scoreManager = new ScoreManager(dependencies.Get<RulesetStore>(), () => beatmapManager, LocalStorage, Realm, API));
Dependencies.Cache(Realm);
return dependencies;

View File

@ -194,7 +194,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("notification arrived", () => notificationOverlay.Verify(n => n.Post(It.IsAny<Notification>()), Times.Once));
AddStep("run notification action", () => lastNotification.Activated());
AddStep("run notification action", () => lastNotification.Activated?.Invoke());
AddAssert("overlay shown", () => overlay.State.Value == Visibility.Visible);
AddAssert("is resumed", () => overlay.CurrentScreen is ScreenUIScale);

View File

@ -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;
@ -19,11 +17,11 @@ namespace osu.Game.Tests.Visual.UserInterface
[TestFixture]
public class TestSceneNotificationOverlay : OsuTestScene
{
private NotificationOverlay notificationOverlay;
private NotificationOverlay notificationOverlay = null!;
private readonly List<ProgressNotification> progressingNotifications = new List<ProgressNotification>();
private SpriteText displayedCount;
private SpriteText displayedCount = null!;
[SetUp]
public void SetUp() => Schedule(() =>
@ -46,7 +44,7 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestCompleteProgress()
{
ProgressNotification notification = null;
ProgressNotification notification = null!;
AddStep("add progress notification", () =>
{
notification = new ProgressNotification
@ -64,7 +62,7 @@ namespace osu.Game.Tests.Visual.UserInterface
[Test]
public void TestCancelProgress()
{
ProgressNotification notification = null;
ProgressNotification notification = null!;
AddStep("add progress notification", () =>
{
notification = new ProgressNotification
@ -112,7 +110,8 @@ namespace osu.Game.Tests.Visual.UserInterface
{
AddStep(@"simple #1", sendHelloNotification);
AddAssert("Is visible", () => notificationOverlay.State.Value == Visibility.Visible);
AddAssert("toast displayed", () => notificationOverlay.ToastCount == 1);
AddAssert("is not visible", () => notificationOverlay.State.Value == Visibility.Hidden);
checkDisplayedCount(1);
@ -185,7 +184,7 @@ namespace osu.Game.Tests.Visual.UserInterface
}
private void checkDisplayedCount(int expected) =>
AddAssert($"Displayed count is {expected}", () => notificationOverlay.UnreadCount.Value == expected);
AddUntilStep($"Displayed count is {expected}", () => notificationOverlay.UnreadCount.Value == expected);
private void sendDownloadProgress()
{

View File

@ -5,7 +5,6 @@ using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
using osu.Framework.Allocation;
using osu.Framework.Extensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Platform;
@ -39,8 +38,6 @@ namespace osu.Game.Tests.Visual.UserInterface
Dependencies.Cache(new RealmRulesetStore(Realm));
Dependencies.Cache(beatmapManager = new BeatmapManager(LocalStorage, Realm, null, Audio, Resources, host, Beatmap.Default));
Dependencies.Cache(Realm);
beatmapManager.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();
}
[SetUp]
@ -66,6 +63,9 @@ namespace osu.Game.Tests.Visual.UserInterface
}
beatmapSets.First().ToLive(Realm);
// Ensure all the initial imports are present before running any tests.
Realm.Run(r => r.Refresh());
});
[Test]
@ -138,7 +138,7 @@ namespace osu.Game.Tests.Visual.UserInterface
AddStep("Add collection", () =>
{
Dependencies.Get<RealmAccess>().Write(r =>
Realm.Write(r =>
{
r.RemoveAll<BeatmapCollection>();
r.Add(new BeatmapCollection("wang"));