mirror of
https://github.com/osukey/osukey.git
synced 2025-05-03 20:57:28 +09:00
Add test coverage of LastPlayed
updating
This commit is contained in:
parent
8820ea4006
commit
4b96d74b0c
@ -1,6 +1,7 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||||
// See the LICENCE file in the repository root for full licence text.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
@ -59,6 +60,20 @@ namespace osu.Game.Tests.Visual.Gameplay
|
|||||||
|
|
||||||
protected override bool AllowFail => false;
|
protected override bool AllowFail => false;
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestLastPlayedUpdated()
|
||||||
|
{
|
||||||
|
DateTimeOffset? getLastPlayed() => Realm.Run(r => r.Find<BeatmapInfo>(Beatmap.Value.BeatmapInfo.ID)?.LastPlayed);
|
||||||
|
|
||||||
|
AddStep("set no custom ruleset", () => customRuleset = null);
|
||||||
|
AddAssert("last played is null", () => getLastPlayed() == null);
|
||||||
|
|
||||||
|
CreateTest();
|
||||||
|
|
||||||
|
AddUntilStep("wait for track to start running", () => Beatmap.Value.Track.IsRunning);
|
||||||
|
AddUntilStep("wait for last played to update", () => getLastPlayed() != null);
|
||||||
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
public void TestScoreStoredLocally()
|
public void TestScoreStoredLocally()
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user