mirror of
https://github.com/osukey/osukey.git
synced 2025-08-08 00:53:56 +09:00
Update outdated tests
This commit is contained in:
@ -407,8 +407,6 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SliderVelocity = 0.1f });
|
|
||||||
|
|
||||||
SelectedMods.Value = new[] { new OsuModClassic() };
|
SelectedMods.Value = new[] { new OsuModClassic() };
|
||||||
|
|
||||||
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
|
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
|
||||||
@ -439,6 +437,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
public TestSlider()
|
public TestSlider()
|
||||||
{
|
{
|
||||||
|
DifficultyControlPoint = new DifficultyControlPoint { SliderVelocity = 0.1f };
|
||||||
|
|
||||||
DefaultsApplied += _ =>
|
DefaultsApplied += _ =>
|
||||||
{
|
{
|
||||||
HeadCircle.HitWindows = new TestHitWindows();
|
HeadCircle.HitWindows = new TestHitWindows();
|
||||||
|
@ -348,6 +348,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
StartTime = time_slider_start,
|
StartTime = time_slider_start,
|
||||||
Position = new Vector2(0, 0),
|
Position = new Vector2(0, 0),
|
||||||
|
DifficultyControlPoint = new DifficultyControlPoint { SliderVelocity = 0.1f },
|
||||||
Path = new SliderPath(PathType.PerfectCurve, new[]
|
Path = new SliderPath(PathType.PerfectCurve, new[]
|
||||||
{
|
{
|
||||||
Vector2.Zero,
|
Vector2.Zero,
|
||||||
@ -362,8 +363,6 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SliderVelocity = 0.1f });
|
|
||||||
|
|
||||||
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
|
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
|
||||||
|
|
||||||
p.OnLoadComplete += _ =>
|
p.OnLoadComplete += _ =>
|
||||||
|
@ -369,8 +369,6 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
Beatmap.Value.Beatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SliderVelocity = 0.1f });
|
|
||||||
|
|
||||||
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
|
var p = new ScoreAccessibleReplayPlayer(new Score { Replay = new Replay { Frames = frames } });
|
||||||
|
|
||||||
p.OnLoadComplete += _ =>
|
p.OnLoadComplete += _ =>
|
||||||
@ -399,6 +397,8 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
{
|
{
|
||||||
public TestSlider()
|
public TestSlider()
|
||||||
{
|
{
|
||||||
|
DifficultyControlPoint = new DifficultyControlPoint { SliderVelocity = 0.1f };
|
||||||
|
|
||||||
DefaultsApplied += _ =>
|
DefaultsApplied += _ =>
|
||||||
{
|
{
|
||||||
HeadCircle.HitWindows = new TestHitWindows();
|
HeadCircle.HitWindows = new TestHitWindows();
|
||||||
|
@ -172,7 +172,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.AreEqual(4, controlPoints.TimingPoints.Count);
|
Assert.AreEqual(4, controlPoints.TimingPoints.Count);
|
||||||
Assert.AreEqual(5, controlPoints.DifficultyPoints.Count);
|
Assert.AreEqual(5, controlPoints.DifficultyPoints.Count);
|
||||||
Assert.AreEqual(34, controlPoints.SamplePoints.Count);
|
Assert.AreEqual(34, controlPoints.SamplePoints.Count);
|
||||||
Assert.AreEqual(8, controlPoints.EffectPoints.Count);
|
Assert.AreEqual(13, controlPoints.EffectPoints.Count);
|
||||||
|
|
||||||
var timingPoint = controlPoints.TimingPointAt(0);
|
var timingPoint = controlPoints.TimingPointAt(0);
|
||||||
Assert.AreEqual(956, timingPoint.Time);
|
Assert.AreEqual(956, timingPoint.Time);
|
||||||
@ -226,7 +226,7 @@ namespace osu.Game.Tests.Beatmaps.Formats
|
|||||||
Assert.IsTrue(effectPoint.KiaiMode);
|
Assert.IsTrue(effectPoint.KiaiMode);
|
||||||
Assert.IsFalse(effectPoint.OmitFirstBarLine);
|
Assert.IsFalse(effectPoint.OmitFirstBarLine);
|
||||||
|
|
||||||
effectPoint = controlPoints.EffectPointAt(119637);
|
effectPoint = controlPoints.EffectPointAt(116637);
|
||||||
Assert.AreEqual(95901, effectPoint.Time);
|
Assert.AreEqual(95901, effectPoint.Time);
|
||||||
Assert.IsFalse(effectPoint.KiaiMode);
|
Assert.IsFalse(effectPoint.KiaiMode);
|
||||||
Assert.IsFalse(effectPoint.OmitFirstBarLine);
|
Assert.IsFalse(effectPoint.OmitFirstBarLine);
|
||||||
|
@ -74,13 +74,13 @@ namespace osu.Game.Tests.Editing
|
|||||||
[TestCase(2)]
|
[TestCase(2)]
|
||||||
public void TestSpeedMultiplier(float multiplier)
|
public void TestSpeedMultiplier(float multiplier)
|
||||||
{
|
{
|
||||||
AddStep($"set multiplier = {multiplier}", () =>
|
assertSnapDistance(100 * multiplier, new HitObject
|
||||||
{
|
{
|
||||||
composer.EditorBeatmap.ControlPointInfo.Clear();
|
DifficultyControlPoint = new DifficultyControlPoint
|
||||||
composer.EditorBeatmap.ControlPointInfo.Add(0, new DifficultyControlPoint { SliderVelocity = multiplier });
|
{
|
||||||
|
SliderVelocity = multiplier
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
assertSnapDistance(100 * multiplier);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[TestCase(1)]
|
[TestCase(1)]
|
||||||
@ -198,8 +198,8 @@ namespace osu.Game.Tests.Editing
|
|||||||
assertSnappedDistance(400, 400);
|
assertSnappedDistance(400, 400);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertSnapDistance(float expectedDistance)
|
private void assertSnapDistance(float expectedDistance, HitObject hitObject = null)
|
||||||
=> AddAssert($"distance is {expectedDistance}", () => composer.GetBeatSnapDistanceAt(new HitObject()) == expectedDistance);
|
=> AddAssert($"distance is {expectedDistance}", () => composer.GetBeatSnapDistanceAt(hitObject ?? new HitObject()) == expectedDistance);
|
||||||
|
|
||||||
private void assertDurationToDistance(double duration, float expectedDistance)
|
private void assertDurationToDistance(double duration, float expectedDistance)
|
||||||
=> AddAssert($"duration = {duration} -> distance = {expectedDistance}", () => composer.DurationToDistance(new HitObject(), duration) == expectedDistance);
|
=> AddAssert($"duration = {duration} -> distance = {expectedDistance}", () => composer.DurationToDistance(new HitObject(), duration) == expectedDistance);
|
||||||
|
Reference in New Issue
Block a user