diff --git a/osu.Game.Tests/Visual/TestCaseOsuGame.cs b/osu.Game.Tests/Visual/TestCaseOsuGame.cs index 9e649b92e4..dd98ff088c 100644 --- a/osu.Game.Tests/Visual/TestCaseOsuGame.cs +++ b/osu.Game.Tests/Visual/TestCaseOsuGame.cs @@ -3,12 +3,30 @@ using System; using System.Collections.Generic; +using System.Linq; using NUnit.Framework; using osu.Framework.Allocation; +using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Shapes; +using osu.Framework.Graphics.Textures; using osu.Framework.Platform; +using osu.Game.Audio; +using osu.Game.Beatmaps; +using osu.Game.Configuration; +using osu.Game.Database; +using osu.Game.Graphics; +using osu.Game.Input; +using osu.Game.Input.Bindings; +using osu.Game.IO; +using osu.Game.Online.API; +using osu.Game.Online.Chat; +using osu.Game.Overlays; +using osu.Game.Rulesets; +using osu.Game.Scoring; using osu.Game.Screens.Menu; +using osu.Game.Skinning; +using osu.Game.Utils; using osuTK.Graphics; namespace osu.Game.Tests.Visual @@ -21,6 +39,52 @@ namespace osu.Game.Tests.Visual typeof(OsuLogo), }; + private IReadOnlyList requiredGameDependencies => new[] + { + typeof(OsuGame), + typeof(RavenLogger), + typeof(Bindable), + typeof(IBindable), + typeof(OsuLogo), + typeof(IdleTracker), + typeof(OnScreenDisplay), + typeof(NotificationOverlay), + typeof(DirectOverlay), + typeof(SocialOverlay), + typeof(ChannelManager), + typeof(ChatOverlay), + typeof(SettingsOverlay), + typeof(UserProfileOverlay), + typeof(BeatmapSetOverlay), + typeof(LoginOverlay), + typeof(MusicController), + typeof(AccountCreationOverlay), + typeof(DialogOverlay), + }; + + private IReadOnlyList requiredGameBaseDependencies => new[] + { + typeof(OsuGameBase), + typeof(DatabaseContextFactory), + typeof(LargeTextureStore), + typeof(OsuConfigManager), + typeof(SkinManager), + typeof(ISkinSource), + typeof(IAPIProvider), + typeof(RulesetStore), + typeof(FileStore), + typeof(ScoreManager), + typeof(BeatmapManager), + typeof(KeyBindingStore), + typeof(SettingsStore), + typeof(RulesetConfigCache), + typeof(OsuColour), + typeof(IBindable), + typeof(Bindable), + typeof(GlobalActionContainer), + typeof(PreviewTrackManager), + }; + [BackgroundDependencyLoader] private void load(GameHost host) { @@ -36,6 +100,11 @@ namespace osu.Game.Tests.Visual }, game }; + + AddUntilStep("wait for load", () => game.IsLoaded); + + AddAssert("check OsuGame DI members", () => requiredGameDependencies.All(d => game.Dependencies.Get(d) != null)); + AddAssert("check OsuGameBase DI members", () => requiredGameBaseDependencies.All(d => Dependencies.Get(d) != null)); } } }