Fix most remaining test issues

This commit is contained in:
Dean Herbert 2022-01-11 19:25:50 +09:00
parent b7ee6d1866
commit 7dba3c3551
6 changed files with 5 additions and 7 deletions

View File

@ -50,6 +50,7 @@ private void load(GameHost host, AudioManager audio)
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
Dependencies.Cache(manager = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, Resources, host, Beatmap.Default));
Dependencies.Cache(new OsuConfigManager(LocalStorage));
Dependencies.Cache(ContextFactory);
manager.Import(TestResources.GetQuickTestBeatmapForImport()).WaitSafely();

View File

@ -49,6 +49,7 @@ private void load(GameHost host, AudioManager audio)
{
Dependencies.Cache(rulesets = new RulesetStore(ContextFactory));
Dependencies.Cache(beatmaps = new BeatmapManager(LocalStorage, ContextFactory, rulesets, null, audio, Resources, host, Beatmap.Default));
Dependencies.Cache(ContextFactory);
}
public override void SetUpSteps()

View File

@ -90,7 +90,7 @@ protected override void LoadComplete()
private void updateAvailability()
{
if (downloadTracker == null)
if (downloadTracker == null || SelectedItem.Value == null)
return;
switch (downloadTracker.State.Value)

View File

@ -223,7 +223,7 @@ protected override void LogoArriving(OsuLogo logo, bool resuming)
if (!resuming)
{
beatmap.Value = initialBeatmap;
Track = initialBeatmap.Track;
Track = beatmap.Value.Track;
// ensure the track starts at maximum volume
musicController.CurrentTrack.FinishTransforms();

View File

@ -676,10 +676,6 @@ private CarouselBeatmapSet createCarouselSet(BeatmapSetInfo beatmapSet)
if (beatmapSet?.IsManaged == true)
beatmapSet = beatmapSet.Detach();
// todo: probably not required any more.
// foreach (var b in beatmapSet.Beatmaps)
// b.Metadata ??= beatmapSet.Metadata;
var set = new CarouselBeatmapSet(beatmapSet)
{
GetRecommendedBeatmap = beatmaps => GetRecommendedBeatmap?.Invoke(beatmaps)

View File

@ -34,7 +34,7 @@ protected RealmArchiveModelManager(Storage storage, RealmContextFactory contextF
}
public void DeleteFile(TModel item, RealmNamedFileUsage file) =>
performFileOperation(item, managed => DeleteFile(managed, file, managed.Realm));
performFileOperation(item, managed => DeleteFile(managed, managed.Files.First(f => f.Filename == file.Filename), managed.Realm));
public void ReplaceFile(TModel item, RealmNamedFileUsage file, Stream contents) =>
performFileOperation(item, managed => ReplaceFile(file, contents, managed.Realm));