1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-13 13:32:54 +08:00

Add a catch specific player test

This commit is contained in:
Dean Herbert 2017-09-19 21:40:57 +09:00
parent 0aa152974a
commit f96875a470
3 changed files with 30 additions and 2 deletions

View File

@ -0,0 +1,20 @@
using NUnit.Framework;
using osu.Game.Beatmaps;
using osu.Game.Rulesets.Catch.Objects;
namespace osu.Game.Rulesets.Catch.Tests
{
[TestFixture]
public class TestCaseCatchPlayer : Game.Tests.Visual.TestCasePlayer
{
protected override Beatmap CreateBeatmap()
{
var beatmap = new Beatmap();
for (int i = 0; i < 256; i++)
beatmap.HitObjects.Add(new Fruit { X = 0.5f, StartTime = i * 100, NewCombo = i % 8 == 0 });
return beatmap;
}
}
}

View File

@ -58,6 +58,7 @@
<Compile Include="Objects\Fruit.cs" /> <Compile Include="Objects\Fruit.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Tests\TestCaseCatcher.cs" /> <Compile Include="Tests\TestCaseCatcher.cs" />
<Compile Include="Tests\TestCaseCatchPlayer.cs" />
<Compile Include="UI\CatcherArea.cs" /> <Compile Include="UI\CatcherArea.cs" />
<Compile Include="UI\CatchRulesetContainer.cs" /> <Compile Include="UI\CatchRulesetContainer.cs" />
<Compile Include="UI\CatchPlayfield.cs" /> <Compile Include="UI\CatchPlayfield.cs" />

View File

@ -16,7 +16,7 @@ using OpenTK.Graphics;
namespace osu.Game.Tests.Visual namespace osu.Game.Tests.Visual
{ {
internal class TestCasePlayer : OsuTestCase public class TestCasePlayer : OsuTestCase
{ {
protected Player Player; protected Player Player;
private RulesetStore rulesets; private RulesetStore rulesets;
@ -45,7 +45,7 @@ namespace osu.Game.Tests.Visual
loadPlayerFor(rulesets.Query<RulesetInfo>().First()); loadPlayerFor(rulesets.Query<RulesetInfo>().First());
} }
private void loadPlayerFor(RulesetInfo r) protected virtual Beatmap CreateBeatmap()
{ {
Beatmap beatmap; Beatmap beatmap;
@ -53,6 +53,13 @@ namespace osu.Game.Tests.Visual
using (var reader = new StreamReader(stream)) using (var reader = new StreamReader(stream))
beatmap = BeatmapDecoder.GetDecoder(reader).Decode(reader); beatmap = BeatmapDecoder.GetDecoder(reader).Decode(reader);
return beatmap;
}
private void loadPlayerFor(RulesetInfo r)
{
var beatmap = CreateBeatmap();
beatmap.BeatmapInfo.Ruleset = r; beatmap.BeatmapInfo.Ruleset = r;
var instance = r.CreateInstance(); var instance = r.CreateInstance();