mirror of
https://github.com/ppy/osu
synced 2024-12-23 15:22:37 +00:00
Add tests for legacy skin decoding
This commit is contained in:
parent
01ac19fdbb
commit
d15db378ce
2
osu.Game.Tests/Resources/skin-20.ini
Normal file
2
osu.Game.Tests/Resources/skin-20.ini
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[General]
|
||||||
|
Version: 2
|
2
osu.Game.Tests/Resources/skin-latest.ini
Normal file
2
osu.Game.Tests/Resources/skin-latest.ini
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[General]
|
||||||
|
Version: latest
|
@ -56,5 +56,16 @@ namespace osu.Game.Tests.Skins
|
|||||||
Assert.AreEqual("TestValue", config.ConfigDictionary["TestLookup"]);
|
Assert.AreEqual("TestValue", config.ConfigDictionary["TestLookup"]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestCase("skin-20.ini", 2.0)]
|
||||||
|
[TestCase("skin-latest.ini", LegacySkinConfiguration.LATEST_VERSION)]
|
||||||
|
[TestCase("skin-empty.ini", null)]
|
||||||
|
public void TestDecodeVersion(string filename, double? expected)
|
||||||
|
{
|
||||||
|
var decoder = new LegacySkinDecoder();
|
||||||
|
using (var resStream = TestResources.OpenResource(filename))
|
||||||
|
using (var stream = new LineBufferedReader(resStream))
|
||||||
|
Assert.AreEqual(expected, decoder.Decode(stream).LegacyVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user