1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Fix TestCasePlaySongSelect

This commit is contained in:
Dean Herbert 2017-10-17 16:02:13 +09:00
parent cf3881b18c
commit ad54ca9268
2 changed files with 6 additions and 3 deletions

View File

@ -1,5 +1,5 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu-framework/master/LICENCE
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Platform;

View File

@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.EntityFrameworkCore;
using osu.Framework.Allocation;
using osu.Framework.MathUtils;
using osu.Game.Beatmaps;
@ -36,9 +37,11 @@ namespace osu.Game.Tests.Visual
{
var storage = new TestStorage(@"TestCasePlaySongSelect");
var dbConnectionString = storage.GetDatabaseConnectionString(@"client");
// this is by no means clean. should be replacing inside of OsuGameBase somehow.
var context = new OsuDbContext(storage.GetDatabaseConnectionString(@"client"));
context.Database.Migrate();
Func<OsuDbContext> contextFactory = () => new OsuDbContext(dbConnectionString);
Func<OsuDbContext> contextFactory = () => context;
dependencies.Cache(rulesets = new RulesetStore(contextFactory));
dependencies.Cache(manager = new BeatmapManager(storage, contextFactory, rulesets, null));