1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Rename fields and make readonly

This commit is contained in:
Craftplacer 2020-08-15 22:06:26 +02:00
parent c4a7fac760
commit 0e8411f76c

View File

@ -32,14 +32,13 @@ namespace osu.Game.Tests.Beatmaps.Formats
private static IEnumerable<string> allBeatmaps = resource_store.GetAvailableResources().Where(res => res.EndsWith(".osu")); private static IEnumerable<string> allBeatmaps = resource_store.GetAvailableResources().Where(res => res.EndsWith(".osu"));
private static Stream beatmapSkinStream = resource_store.GetStream("skin.ini"); private static readonly Stream beatmap_skin_stream = resource_store.GetStream("skin.ini");
private ISkin skin; private ISkin skin;
[SetUp] [SetUp]
public void Init() public void Init()
{ {
skin = decodeSkinFromLegacy(beatmapSkinStream); skin = decodeSkinFromLegacy(beatmap_skin_stream);
} }
[TestCaseSource(nameof(allBeatmaps))] [TestCaseSource(nameof(allBeatmaps))]
@ -76,14 +75,12 @@ namespace osu.Game.Tests.Beatmaps.Formats
return new LegacySkin(SkinInfo.Default, resource_store, null); return new LegacySkin(SkinInfo.Default, resource_store, null);
} }
private Stream encodeToLegacy(IBeatmap beatmap, ISkin skin) private Stream encodeToLegacy(IBeatmap beatmap, ISkin beatmapSkin)
{ {
var stream = new MemoryStream(); var stream = new MemoryStream();
using (var writer = new StreamWriter(stream, Encoding.UTF8, 1024, true)) using (var writer = new StreamWriter(stream, Encoding.UTF8, 1024, true))
{ new LegacyBeatmapEncoder(beatmap, beatmapSkin).Encode(writer);
new LegacyBeatmapEncoder(beatmap, skin).Encode(writer);
}
stream.Position = 0; stream.Position = 0;