Remove default combo colours on empty skin test

Checked differently in TestSceneSkinConfigurationLookup.TestEmptyComboColours()
This commit is contained in:
iiSaLMaN 2019-10-09 21:15:30 +03:00
parent c2ada81c23
commit 8d40c1b733
2 changed files with 10 additions and 17 deletions

View File

@ -1,2 +0,0 @@
[General]
Name: test skin

View File

@ -13,28 +13,23 @@ namespace osu.Game.Tests.Skins
[TestFixture] [TestFixture]
public class LegacySkinDecoderTest public class LegacySkinDecoderTest
{ {
[TestCase(true)] [Test]
[TestCase(false)] public void TestDecodeSkinColours()
public void TestDecodeSkinColours(bool hasColours)
{ {
var decoder = new LegacySkinDecoder(); var decoder = new LegacySkinDecoder();
using (var resStream = TestResources.OpenResource(hasColours ? "skin.ini" : "skin-empty.ini")) using (var resStream = TestResources.OpenResource("skin.ini"))
using (var stream = new LineBufferedReader(resStream)) using (var stream = new LineBufferedReader(resStream))
{ {
var comboColors = decoder.Decode(stream).ComboColours; var comboColors = decoder.Decode(stream).ComboColours;
List<Color4> expectedColors; List<Color4> expectedColors = new List<Color4>
if (hasColours) {
expectedColors = new List<Color4> new Color4(142, 199, 255, 255),
{ new Color4(255, 128, 128, 255),
new Color4(142, 199, 255, 255), new Color4(128, 255, 255, 255),
new Color4(255, 128, 128, 255), new Color4(100, 100, 100, 100),
new Color4(128, 255, 255, 255), };
new Color4(100, 100, 100, 100),
};
else
expectedColors = new DefaultSkin().Configuration.ComboColours;
Assert.AreEqual(expectedColors.Count, comboColors.Count); Assert.AreEqual(expectedColors.Count, comboColors.Count);
for (int i = 0; i < expectedColors.Count; i++) for (int i = 0; i < expectedColors.Count; i++)