Remove SingletonContextFactory

It is dangerous to use this as it doesn't correctly handle contexts and can cause issues that will never actually arise in normal execution.
This commit is contained in:
Dean Herbert
2018-07-18 16:43:46 +09:00
parent 90840c9384
commit 1d52231d4f
5 changed files with 15 additions and 31 deletions

View File

@ -62,7 +62,12 @@ namespace osu.Game.Tests.Visual
var storage = new TestStorage(@"TestCasePlaySongSelect");
// this is by no means clean. should be replacing inside of OsuGameBase somehow.
IDatabaseContextFactory factory = new SingletonContextFactory(new OsuDbContext());
DatabaseContextFactory factory = new DatabaseContextFactory(storage);
factory.ResetDatabase();
using (var usage = factory.Get())
usage.Migrate();
Dependencies.Cache(rulesets = new RulesetStore(factory));
Dependencies.Cache(manager = new BeatmapManager(storage, factory, rulesets, null, null)