Support mods for beatmap conversion tests (#5556)

Support mods for beatmap conversion tests

Co-authored-by: Dean Herbert <pe@ppy.sh>
This commit is contained in:
Dean Herbert 2019-08-05 11:11:49 +02:00 committed by GitHub
commit 73c48811bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 20 deletions

View File

@ -22,10 +22,7 @@ namespace osu.Game.Rulesets.Catch.Tests
[TestCase("spinner")]
[TestCase("spinner-and-circles")]
[TestCase("slider")]
public new void Test(string name)
{
base.Test(name);
}
public void Test(string name) => base.Test(name);
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
{

View File

@ -20,10 +20,7 @@ namespace osu.Game.Rulesets.Mania.Tests
protected override string ResourceAssembly => "osu.Game.Rulesets.Mania";
[TestCase("basic")]
public new void Test(string name)
{
base.Test(name);
}
public void Test(string name) => base.Test(name);
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
{

View File

@ -23,10 +23,7 @@ namespace osu.Game.Rulesets.Osu.Tests
[TestCase("slider-ticks")]
[TestCase("repeat-slider")]
[TestCase("uneven-repeat-slider")]
public new void Test(string name)
{
base.Test(name);
}
public void Test(string name) => base.Test(name);
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
{

View File

@ -20,10 +20,7 @@ namespace osu.Game.Rulesets.Taiko.Tests
[NonParallelizable]
[TestCase("basic")]
[TestCase("slider-generating-drumroll")]
public new void Test(string name)
{
base.Test(name);
}
public void Test(string name) => base.Test(name);
protected override IEnumerable<ConvertValue> CreateConvertValue(HitObject hitObject)
{

View File

@ -28,9 +28,9 @@ namespace osu.Game.Tests.Beatmaps
protected abstract string ResourceAssembly { get; }
protected void Test(string name)
protected void Test(string name, params Type[] mods)
{
var ourResult = convert(name);
var ourResult = convert(name, mods.Select(m => (Mod)Activator.CreateInstance(m)).ToArray());
var expectedResult = read(name);
Assert.Multiple(() =>
@ -92,7 +92,7 @@ namespace osu.Game.Tests.Beatmaps
});
}
private ConvertResult convert(string name)
private ConvertResult convert(string name, Mod[] mods)
{
var beatmap = getBeatmap(name);
@ -110,7 +110,7 @@ namespace osu.Game.Tests.Beatmaps
}
};
working.GetPlayableBeatmap(rulesetInstance.RulesetInfo, Array.Empty<Mod>());
working.GetPlayableBeatmap(rulesetInstance.RulesetInfo, mods);
return new ConvertResult
{