Rename RealmContextFactory to RealmAccess

This commit is contained in:
Dean Herbert
2022-01-24 19:59:58 +09:00
parent bb54ad9ad8
commit 6eb2c28e41
76 changed files with 516 additions and 516 deletions

View File

@ -21,15 +21,15 @@ namespace osu.Game.Tests.Database
[Test]
public void TestConstructRealm()
{
RunTestWithRealm((realmFactory, _) => { realmFactory.Run(realm => realm.Refresh()); });
RunTestWithRealm((realm, _) => { realm.Run(r => r.Refresh()); });
}
[Test]
public void TestBlockOperations()
{
RunTestWithRealm((realmFactory, _) =>
RunTestWithRealm((realm, _) =>
{
using (realmFactory.BlockAllOperations())
using (realm.BlockAllOperations())
{
}
});
@ -42,22 +42,22 @@ namespace osu.Game.Tests.Database
[Test]
public void TestNestedContextCreationWithSubscription()
{
RunTestWithRealm((realmFactory, _) =>
RunTestWithRealm((realm, _) =>
{
bool callbackRan = false;
realmFactory.RegisterCustomSubscription(realm =>
realm.RegisterCustomSubscription(r =>
{
var subscription = realm.All<BeatmapInfo>().QueryAsyncWithNotifications((sender, changes, error) =>
var subscription = r.All<BeatmapInfo>().QueryAsyncWithNotifications((sender, changes, error) =>
{
realmFactory.Run(_ =>
realm.Run(_ =>
{
callbackRan = true;
});
});
// Force the callback above to run.
realmFactory.Run(r => r.Refresh());
realm.Run(rr => rr.Refresh());
subscription?.Dispose();
return null;
@ -70,14 +70,14 @@ namespace osu.Game.Tests.Database
[Test]
public void TestBlockOperationsWithContention()
{
RunTestWithRealm((realmFactory, _) =>
RunTestWithRealm((realm, _) =>
{
ManualResetEventSlim stopThreadedUsage = new ManualResetEventSlim();
ManualResetEventSlim hasThreadedUsage = new ManualResetEventSlim();
Task.Factory.StartNew(() =>
{
realmFactory.Run(_ =>
realm.Run(_ =>
{
hasThreadedUsage.Set();
@ -89,7 +89,7 @@ namespace osu.Game.Tests.Database
Assert.Throws<TimeoutException>(() =>
{
using (realmFactory.BlockAllOperations())
using (realm.BlockAllOperations())
{
}
});