From 967d0c3c72269e9fad90d090601c71a25a186ec5 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Fri, 20 Jul 2018 15:12:04 +0900 Subject: [PATCH] Adjust testcase --- .../Formats/LegacyBeatmapDecoderTest.cs | 18 +++++++++--------- ....osu => controlpoint-custom-samplebank.osu} | 0 ...-samples.osu => hitobject-file-samples.osu} | 0 3 files changed, 9 insertions(+), 9 deletions(-) rename osu.Game.Tests/Resources/{custom-samples.osu => controlpoint-custom-samplebank.osu} (100%) rename osu.Game.Tests/Resources/{custom-hitobject-samples.osu => hitobject-file-samples.osu} (100%) diff --git a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs index 2f5b4a13d9..6b72dc5733 100644 --- a/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs +++ b/osu.Game.Tests/Beatmaps/Formats/LegacyBeatmapDecoderTest.cs @@ -214,10 +214,10 @@ namespace osu.Game.Tests.Beatmaps.Formats } [Test] - public void TestDecodeCustomSamples() + public void TestDecodeControlPointCustomSampleBank() { var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false }; - using (var resStream = Resource.OpenResource("custom-samples.osu")) + using (var resStream = Resource.OpenResource("controlpoint-custom-samplebank.osu")) using (var stream = new StreamReader(resStream)) { var hitObjects = decoder.Decode(stream).HitObjects; @@ -228,25 +228,25 @@ namespace osu.Game.Tests.Beatmaps.Formats Assert.AreEqual("normal-hitnormal", getTestableSampleInfo(hitObjects[3]).LookupNames.First()); } - SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(new SampleInfo { Name = "hitnormal" }); + SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]); } [Test] - public void TestDecodeCustomHitObjectSamples() + public void TestDecodeHitObjectCustomSampleBank() { var decoder = new LegacyBeatmapDecoder { ApplyOffsets = false }; - using (var resStream = Resource.OpenResource("custom-hitobject-samples.osu")) + using (var resStream = Resource.OpenResource("hitobject-custom-samplebank.osu")) using (var stream = new StreamReader(resStream)) { var hitObjects = decoder.Decode(stream).HitObjects; - Assert.AreEqual("hit_1.wav", hitObjects[0].Samples[0].LookupNames.First()); - Assert.AreEqual("hit_2.wav", hitObjects[1].Samples[0].LookupNames.First()); + Assert.AreEqual("hit_1.wav", getTestableSampleInfo(hitObjects[0]).LookupNames.First()); + Assert.AreEqual("hit_2.wav", getTestableSampleInfo(hitObjects[1]).LookupNames.First()); Assert.AreEqual("normal-hitnormal2", getTestableSampleInfo(hitObjects[2]).LookupNames.First()); - Assert.AreEqual("hit_1.wav", hitObjects[3].Samples[0].LookupNames.First()); + Assert.AreEqual("hit_1.wav", getTestableSampleInfo(hitObjects[3]).LookupNames.First()); } - SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(new SampleInfo { Name = "hitnormal" }); + SampleInfo getTestableSampleInfo(HitObject hitObject) => hitObject.SampleControlPoint.ApplyTo(hitObject.Samples[0]); } } } diff --git a/osu.Game.Tests/Resources/custom-samples.osu b/osu.Game.Tests/Resources/controlpoint-custom-samplebank.osu similarity index 100% rename from osu.Game.Tests/Resources/custom-samples.osu rename to osu.Game.Tests/Resources/controlpoint-custom-samplebank.osu diff --git a/osu.Game.Tests/Resources/custom-hitobject-samples.osu b/osu.Game.Tests/Resources/hitobject-file-samples.osu similarity index 100% rename from osu.Game.Tests/Resources/custom-hitobject-samples.osu rename to osu.Game.Tests/Resources/hitobject-file-samples.osu