mirror of
https://github.com/osukey/osukey.git
synced 2025-08-04 15:16:38 +09:00
Add automatic transaction handling to realm helper methods
This commit is contained in:
@ -59,6 +59,25 @@ namespace osu.Game.Tests.Database
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestNestedWriteCalls()
|
||||
{
|
||||
RunTestWithRealm((realm, _) =>
|
||||
{
|
||||
var beatmap = new BeatmapInfo(CreateRuleset(), new BeatmapDifficulty(), new BeatmapMetadata());
|
||||
|
||||
var liveBeatmap = beatmap.ToLive(realm);
|
||||
|
||||
realm.Run(r =>
|
||||
r.Write(_ =>
|
||||
r.Write(_ =>
|
||||
r.Add(beatmap)))
|
||||
);
|
||||
|
||||
Assert.IsFalse(liveBeatmap.PerformRead(l => l.Hidden));
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestAccessAfterAttach()
|
||||
{
|
||||
|
Reference in New Issue
Block a user