1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 01:23:44 +08:00
osu-lazer/osu.Game.Rulesets.Taiko.Tests/TaikoScoreProcessorTest.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

42 lines
1.4 KiB
C#
Raw Normal View History

2023-12-19 13:01:08 +08:00
// 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.
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Judgements;
using osu.Game.Rulesets.Objects;
using osu.Game.Rulesets.Scoring;
using osu.Game.Rulesets.Taiko.Judgements;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.Scoring;
namespace osu.Game.Rulesets.Taiko.Tests
{
[TestFixture]
public class TaikoScoreProcessorTest
2023-12-19 13:01:08 +08:00
{
[Test]
public void TestInaccurateHitScore()
{
var beatmap = new Beatmap<HitObject>
{
HitObjects =
{
new Hit(),
new Hit { StartTime = 1000 }
}
};
var scoreProcessor = new TaikoScoreProcessor();
scoreProcessor.ApplyBeatmap(beatmap);
// Apply a miss judgement
scoreProcessor.ApplyResult(new JudgementResult(beatmap.HitObjects[0], new TaikoJudgement()) { Type = HitResult.Great });
scoreProcessor.ApplyResult(new JudgementResult(beatmap.HitObjects[1], new TaikoJudgement()) { Type = HitResult.Ok });
Assert.That(scoreProcessor.TotalScore.Value, Is.EqualTo(453745));
Assert.That(scoreProcessor.Accuracy.Value, Is.EqualTo(0.75).Within(0.0001));
}
}
}