mirror of
https://github.com/ppy/osu
synced 2025-01-12 00:59:35 +00:00
Update test to use GetForWrite
This commit is contained in:
parent
2988700bea
commit
693602513e
@ -11,6 +11,7 @@ using osu.Framework.Platform;
|
||||
using osu.Game.Database;
|
||||
using osu.Game.Input;
|
||||
using osu.Game.Input.Bindings;
|
||||
using Realms;
|
||||
|
||||
namespace osu.Game.Tests.Database
|
||||
{
|
||||
@ -62,12 +63,15 @@ namespace osu.Game.Tests.Database
|
||||
|
||||
Assert.That(backBinding.KeyCombination.Keys, Is.EquivalentTo(new[] { InputKey.Escape }));
|
||||
|
||||
var binding = backBinding;
|
||||
var tsr = ThreadSafeReference.Create(backBinding);
|
||||
|
||||
realmContextFactory.Context.Write(() =>
|
||||
using (var usage = realmContextFactory.GetForWrite())
|
||||
{
|
||||
var binding = usage.Realm.ResolveReference(tsr);
|
||||
binding.KeyCombination = new KeyCombination(InputKey.BackSpace);
|
||||
});
|
||||
|
||||
usage.Commit();
|
||||
}
|
||||
|
||||
Assert.That(backBinding.KeyCombination.Keys, Is.EquivalentTo(new[] { InputKey.BackSpace }));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user