mirror of
https://github.com/osukey/osukey.git
synced 2025-04-29 10:47:22 +09:00
Add test coverage for failure case
This commit is contained in:
parent
cff3e06ad6
commit
830e243d12
@ -8,6 +8,7 @@ using osu.Framework.Graphics;
|
|||||||
using osu.Framework.Testing;
|
using osu.Framework.Testing;
|
||||||
using osu.Game.Beatmaps;
|
using osu.Game.Beatmaps;
|
||||||
using osu.Game.Beatmaps.ControlPoints;
|
using osu.Game.Beatmaps.ControlPoints;
|
||||||
|
using osu.Game.Rulesets.Judgements;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
using osu.Game.Rulesets.Objects.Drawables;
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Scoring;
|
using osu.Game.Rulesets.Scoring;
|
||||||
@ -137,6 +138,31 @@ namespace osu.Game.Tests.Gameplay
|
|||||||
AddAssert("DHO state is correct", () => dho.State.Value == ArmedState.Miss);
|
AddAssert("DHO state is correct", () => dho.State.Value == ArmedState.Miss);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void TestResultSetBeforeLoadComplete()
|
||||||
|
{
|
||||||
|
TestDrawableHitObject dho = null;
|
||||||
|
HitObjectLifetimeEntry lifetimeEntry = null;
|
||||||
|
AddStep("Create lifetime entry", () =>
|
||||||
|
{
|
||||||
|
var hitObject = new HitObject { StartTime = Time.Current };
|
||||||
|
lifetimeEntry = new HitObjectLifetimeEntry(hitObject)
|
||||||
|
{
|
||||||
|
Result = new JudgementResult(hitObject, hitObject.CreateJudgement())
|
||||||
|
{
|
||||||
|
Type = HitResult.Great
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
AddStep("Create DHO and apply entry", () =>
|
||||||
|
{
|
||||||
|
dho = new TestDrawableHitObject();
|
||||||
|
dho.Apply(lifetimeEntry);
|
||||||
|
Child = dho;
|
||||||
|
});
|
||||||
|
AddAssert("DHO state is correct", () => dho.State.Value, () => Is.EqualTo(ArmedState.Hit));
|
||||||
|
}
|
||||||
|
|
||||||
private partial class TestDrawableHitObject : DrawableHitObject
|
private partial class TestDrawableHitObject : DrawableHitObject
|
||||||
{
|
{
|
||||||
public const double INITIAL_LIFETIME_OFFSET = 100;
|
public const double INITIAL_LIFETIME_OFFSET = 100;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user