mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Rename RealmContextFactory
to RealmAccess
This commit is contained in:
@ -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())
|
||||
{
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user