2020-03-31 05:57:37 +00: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 System.Collections.Generic;
|
|
|
|
|
using osu.Game.Rulesets.Mania.Beatmaps;
|
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Mania.Tests
|
|
|
|
|
{
|
|
|
|
|
[TestFixture]
|
2022-10-04 09:24:49 +00:00
|
|
|
|
public class ManiaSpecialColumnTest
|
2020-03-31 05:57:37 +00:00
|
|
|
|
{
|
|
|
|
|
[TestCase(new[]
|
|
|
|
|
{
|
2022-10-04 09:24:49 +00:00
|
|
|
|
true
|
2020-03-31 05:57:37 +00:00
|
|
|
|
}, 1)]
|
|
|
|
|
[TestCase(new[]
|
|
|
|
|
{
|
2022-10-04 09:24:49 +00:00
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false
|
2020-03-31 05:57:37 +00:00
|
|
|
|
}, 4)]
|
|
|
|
|
[TestCase(new[]
|
|
|
|
|
{
|
2022-10-04 09:24:49 +00:00
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
true,
|
|
|
|
|
false,
|
|
|
|
|
false,
|
|
|
|
|
false
|
2020-03-31 05:57:37 +00:00
|
|
|
|
}, 7)]
|
2022-10-04 09:24:49 +00:00
|
|
|
|
public void Test(IEnumerable<bool> special, int columns)
|
2020-03-31 05:57:37 +00:00
|
|
|
|
{
|
2022-10-05 10:14:31 +00:00
|
|
|
|
var definition = new StageDefinition(columns);
|
2020-03-31 05:57:37 +00:00
|
|
|
|
var results = getResults(definition);
|
2022-10-04 09:24:49 +00:00
|
|
|
|
Assert.AreEqual(special, results);
|
2020-03-31 05:57:37 +00:00
|
|
|
|
}
|
|
|
|
|
|
2022-10-04 09:24:49 +00:00
|
|
|
|
private IEnumerable<bool> getResults(StageDefinition definition)
|
2020-03-31 05:57:37 +00:00
|
|
|
|
{
|
2021-10-27 04:04:41 +00:00
|
|
|
|
for (int i = 0; i < definition.Columns; i++)
|
2022-10-04 09:24:49 +00:00
|
|
|
|
yield return definition.IsSpecialColumn(i);
|
2020-03-31 05:57:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|